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 Flex SDK which you can download from Adobe.

Flex SDK
The free Adobe Flex SDK

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 OSFlash or RIAForge 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 you can even get the full version for free.

If you are a student, a faculty member or an unemployed developer, you can  download  Flash Builder Standard for free from Adobe. FDT has a similar deal for universities. Of course, you can also use any 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 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.

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 relatively recent and very interesting addition to 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, 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 already 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, video, type, 3D, animation, interactivity. 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, Away3D, flosc, Nape, Box2DFlashAs3, and many more (check Adrian Parr’s list for a roundup of the better ones).

You can also use various protocols common in a physical computing context such as MIDI, 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 or Processing 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

You will have to trust me on this one for now. I’ll fill in the details as soon as I get a little time.

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 but I guess it’s still too small…

Anyway, to get more details regarding the future of Flash, check out the roadmap that Adobe published in early 2012. 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>