Adobe Flash Platform

Using the Flash Platform in Physical Computing Projects

The Flash Platform is an amazing environment to develop physical computing projects. It’s easy to learn, ubiquitous, well-supported and, this might be a shocker for some people, it can be completely free. In this article, I will tell you why the Flash Platform is my goto choice for physical computing projects.

I’m not necessarily suggesting that the Flash platform is the best environment for all physical computing endeavours. But, after reading this article, you probably will agree that it’s a pretty good choice. By the way, by “Flash Platform” I loosely mean all applications and libraries that deal with ActionScript 3 code and SWF files. This includes products such as Flash Player, the AIR Runtime, the Flash Pro IDE, Adobe/Apache Flex, etc.

Full disclosure: I do not work for Adobe and I’m not receiving any compensation from them either. I just think the Flash Platform makes sense for my students’ needs and probably yours too.

So without further ado, the top reasons to consider the Flash Platform in your physical computing projects…

1. It’s free (well, it can be)

“Wait, what ? Flash Pro is not free!” Not, it’s not. But you don’t absolutely need it either. The Flash Player is free. The AIR Runtime is free. The ActionScript language and APIs are fully documented online. Best of all, ActionScript 3 code can be compiled with the free AIR SDK which you can download from Adobe.

Even your streaming media server can be free if you go with Red5 or Mammoth. I almost forgot Flex, which is now an open source Apache Foundation project. Check out GitHub or Google Code for more Flash-related open source projects.

“That’s all good but that does not give me an IDE?” Well, if you’re on Windows, grab yourself a copy of the free and very good FlashDevelop and you’re all set. If you are on Mac, you should look at FDT Free. FDT is one of the best ActionScript IDE there is and the free version is pretty capable. If you are an open source developer (or in the education sector) you can even get the full version for free.

Of course, you can also use any ol’ text editor but you will probably miss the auto-completion, syntax highlighting and other goodies that come with full IDEs.

You can even write and compile ActionScript 3 code directly in your browser by using a neat free service called wonderfl. It is also a great resource to learn by example as most code is open source and sharing is encouraged. There is even a version of wonderfl targeted specifically at physical computing.

“But how do I create my multimedia assets?” Well, that’s up to you. You can buy Flash Pro or you can generate artwork, sprite sheets, sounds, videos, etc. from whatever app suits your needs best. You can then bring them into your ActionScript project using the embed metatag :

[Embed(source = "../assets/test.gif")]
private var theClass:Class;

With a little effort, you can setup a completely free production chain with the tools mentionned above and various open source tools (Gimp, Audacity, Inkscape, Blender, etc.). Personally, I think that the Adobe Creative Cloud membership is worth every penny (especially the student/teacher edition) but the point here is that money cannot be an argument against it.

2. It’s compatible

By this I do not mean only Mac and Windows. That’s a given. I mean Mac desktops, Mac browsers, Windows desktops, Windows browsers, iOS devices (iPhone/iPad/iPod), Android devices, Blackberry devices, etc. We are still waiting for Windows Phone support but no other user-friendly development platform even remotely compares to that kind of widespread support.

If you are working on projects targeting more than one of these platforms, or are using mobile devices as triggers or controllers, the Flash Platform makes it very easy. One codebase and off you go.

A very interesting capability of the platform is the possibility to create ANEs (AIR Native Extensions). This means you can use C or Java to write native code and use it in ActionScript. This will most likely prove very handy to directly talk to all sorts of external devices. ANEs are already available for the Arduino, the Kinect, the LeapMotion, the Oculus Rift, etc. The great thing about these extensions is that they free us from the hassle of using middleman software between AIR and the devices. The days of TinkerProxy, flosc and others are counted… Many more of these ANEs will surely appear in the coming months. There is a website dedicated specifically to them: extensionsforair.com. Obviously, ANEs are only available in the AIR Runtime but, generally-speaking, AIR is a much better choice in a physical computing context than the Flash Player.

3. It’s mature and feature-rich

The Flash Platform is very mature and has all the goodies expected of a multimedia environment (take a look at the API reference if you’re not convinced). With Scout, it even has a pretty amazing performance profiler. It can handle audio input and output (including sound synthesis), video (processing, webcam support, etc.), type, 2D, 3D, animation, database, file handling, interactivity, device interaction, etc. The AIR runtime supports multiple monitors. It has all the networking features one can hope for. It has a mature toolset and language.

There are tons of AS3 libraries useful in a physical computing context such as the FLARToolkit, the Sound Editor Library, my own modest ChromaTracker, Face recognition, Away3D, flosc, Nape, Box2DFlashAs3, and many more. Actually, I just started a site dedicated to physical computing on the Flash Platform where I host a list of libraries related to the field. The site is in very beta stage but what the heck…

You can also use various protocols common in a physical computing context such as MIDI (although support could be improved), TUIO or OSC.

It’s also easy to interface Flash/AIR with many devices. There are libraries for the Phidgets devices and sensors, for the Arduino microcontroller (as3glue, funnel), for the Wiimote, for the LeapMotion controller, for the Kinect, (airKinect, as3kinect), etc.

4. It’s powerful

Flash used to suffer when its rendering performance was compared to compiled-code engines and frameworks (openFrameworks, for instance). But, with the advent of Stage3D, Flash now has a lot of graphics power. The canonical example is Unreal 3 playing inside of Flash Player. That ought to be quite enough for a vast majority of physical computing projects.

And if its not, you can always use native code to perform the heavy calculations through the use of ANEs.

5. It’s got a great community

There are hundreds (if not thousands) of sites dedicated to Flash/AIR/Flex. It’s still a very rich community. Now that the HTML5 buzz is starting to fade away in the face of reality, the Flash community is to regainaing its pride.

Also, there are about a gazillions books written about the Flash Platform. As an example, Amazon turns up over 1000 book results for the keyword ‘actionscript’.

That’s all fine and good but what about the future ?

Adobe is currently gearing the Flash runtimes (AIR and Flash Player) mostly towards gaming, mobile development and  premium (encrypted) video. It has already made several moves in this direction and is also incorporating more application-like functionalities (middle-click support for example) to the runtimes.

Even though Adobe is not improving its platform with physical computing in mind, any improvements in terms of functionalities and performance are always welcome. Actually, now that we speak of it, I’d love Adobe to consider physical computing one of the target markets for the Flash Platform. One can dream…

Anyway, to get more details regarding the future of Flash, check out the roadmap published by Adobe. This roadmap sets a 5 to 10 year target lifespan for the next version of the ActionScript language and for Flash Player. It does seem as though Adobe is still very committed to Flash.

What about you ?

How do you use the Flash Platform within physical computing projects, installation projects, generative art projects, etc. ? What made you choose this platform ? Which technologies (hardware and software) are you interfacing with ? I’d love to hear about all that and make my own physical computing class even better.

I hope to hear from you guys.

Post a comment

You may use the following HTML:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>