As part of my multi-touch session at Flashbelt I introduced a new API for getting true multi-touch gestures in Flash. Windows 7 has a pretty big limitation when it comes to gestures as it is only capable of doing one at a time. Since Flash listens for these native events, we also get that limitation when doing multi-touch in Flash.
Tim Kukulski, who is a member of the Adobe XD team, has written a great set of classes that listens for raw touch events instead of the built-in gestures. The main class, called MultiDraggable, does all of the work for you and allows you to quickly add zoom, rotate, and drag gestures to any DisplayObject. See the video below for an example.
The code needed to implement the gesture effects is extremely simple. Below is a code snippet of how to do it. You simply add your DisplayObject to the display list of a MultiDraggable instance. Then add the MultiDraggable instance to the main display list.
// box is a MovieClip in the library
var b:MovieClip = new box();
var dragme:MultiDraggable = new MultiDraggable();
Big thanks to Tim for releasing this code. Photos and artwork in the video are from Ralph and Mario. Go ahead and download the files and have fun spawning multiple gestures!
I recently blogged about the Ads optimization topic. I finished writing a little whitepaper on this, covering mainly graphical optimizations with topics like shapes optimizations, framerate, the usage of video, filters and other graphical effects. The paper is mainly targeting designers and interactive designers rather than developers, which was more the audience of the previous [...]
Microsoft Surface has a cool simulation that allows you to drag your fingers across the table to create a water simulation. That got me to thinking about doing it in Flash. Thanks to David Lenaerts’ excellent Ripple class, it took me about 10 minutes to create the example below.
As you can see the performance is very nice. The code that I used to create this is below. Again, all of the cool stuff comes from David’s code.
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
t = new Bitmap(new bmap());
r = new Rippler(t, 60, 6);
r.drawRipple(e.stageX, e.stageY, 20, 1);
I just uploaded a new tutorial that explains how to respond and handle raw touch data in Flash Player 10.1. In a previous tutorial I showed how to respond to gestures, but in touch mode you can track all of the touch points on your screen. The 3M display that I am using supports up [...]
When developing Flash content, profiling the VM or custom code called can be done through the profiler bundled in Flash Builder or through the Flash Player configuration file (mm.cfg). Those give you low level details about the VM but does not give you an overview of what is happening behind the scenes concerning the rendering [...]
There are moments like this, when you read the documentation of the Flash Player and you discover and nice new API that you have been waiting for such a long time. Do you see what I mean ? Yes, you read it right, ByteArray access to NetStream class is coming and it works beautifully in [...]
Advanced Text Layout With Flash CS5
Flash Player 10.1 introduces a full, native multi-touch API that allows you to create some amazing applications. In this session I demonstrate how to build applications using native multi-touch feedback as well as how to use the built-in gesture support for things like scaling and rotating.
Introduction to Multi-Touch in Flash Player 10.1
I give an introduction to some of the new Text Layout features and functionality in Flash CS5.
You may have read my earlier post about needing to not have two many files in your ActionScript source path in Flash CS5. After a certain number of files is reached, Flash will basically abort. This is to prevent Flash from indexing your entire hard drive if you happen to save your file in the top level of your disk (i.e c:\). Now the limit is actually 1000 files by default, but as hardcore Flashers know, sometimes your global AS directory can be much larger. Well luckily there is a way to change this limit. WARNING: do not change this if you are uncomfortable with editing your registry. Also do not change this and then complain that Flash is running slow when you save your FLA into your root directory of your hard drive.
- Open Regedit and navigate to: HKEY_CURRENT_USER > Software > Adobe > Flash 11 > Settings
- Right+click and choose: ‘New… > DWORD Value’
- Rename the key: Project File Cap
- Select the key and choose: ‘Modify’
- Edit the value as either hex or decimal: 1000
- Click OK and restart Flash
- Open ‘/Users//Library/Preferences/Flash CS5 Preferences’ in Text Edit
- Under the section add the following:
- Save the file and restart Flash
What should you set it at? Well if you are good about saving your FLA files into their own folders, then it doesn’t really matter. I would try 5000 and see if that works. You can always change it back. Adobe is working on an official TechNote about this too.
I’m sure that most people who frequent this blog have already downloaded the Flash CS5 trial and started playing with it. If not, go over to the Adobe site to get it. One of the coolest new features is custom class introspection in the Actions editor. There is one important thing to be aware of though in order to get things running smoothly. In the screenshot below you will notice that a yellow warning sign appeared in the bottom-right of the panel when I tried to use code hinting. This means that Flash found too many files on the classpath and basically it stopped looking for custom ActionScript files.
Ok so what does all this mean? If you set a source folder in your ActionScript settings, you need to be sure that it is not a top-level folder on your system or any other folder that has a large amount of sub-directories in it. When Flash starts traversing that folder it will only go so far before bailing out. The fix? Just make sure that you point Flash to a dedicated directory of source files and also save your FLA file into its own folder rather than just plopping it onto the desktop. If you do get the little yellow warning, you will have to relaunch Flash in order to fix the issue once you move your files to a more appropriate location.
I am working on a new document on Flash Ads performance, the idea of this document is to focus on graphical optimizations, cause ActionScript is rarely (sometimes it is) in fault in ads, and mainly created by designers. Flash ads talks to anyone, we all see them when browsing different websites, some of them [...]