Flash in your pants
Posted on .
Today, Adobe announced that the next version of Flash, CS 5, will build native iPhone apps using Actionscript 3. As this pretty much directly intersects with what I do for a living[1], I (predictably) have an opinion on the matter, one that’s perhaps even a bit informed. To set the record straight, I used to do a lot of Flash development, though I haven’t touched it much in the past few years, haven’t seen any of the pre-beta Flash CS 5 bits and adore my iPhone.
So, what, exactly, did Adobe announce? Essentially, that it will be possible to compile a Flash file, written in Actionscript 3, to a native iPhone app, instead of compiling it to a something that runs inside of a web browser. Regardless of what you may think of the merits of such a thing, you have to admit it’s a rather clever bit of engineering to target such a wholly different environment. Of course, clever bits of engineering do not good application platforms make.
You might be tempted to think of Java, with its promise of “write once, run anywhere” that was so pervasive and misguided about ten years ago, but that analogy isn’t quite right. In fact, the way Flash works inside of a browser is actually much more akin to Java – the Flash plug-in is a virtual machine that executes the compiled Flash movie (as they’re called, betraying their history as a frame-based animation tool); iPhone Flash apps seem to more closely resemble RealBasic. This is something quite a bit different in that there is no virtual machine, because that would violate the terms of the iPhone SDK, but rather the code is compiled to native iPhone assembly language. Like I said, it’s certainly clever.
Development appears to be very similar to writing an AIR app – access to the filesystem, SQLite, etc. use the AIR APIs. This is, in essence, AIR for the iPhone, minus the virtual machine that you would otherwise have to install on your machine[2]. Adobe also seems to have ported the Flash drawing API and included support for accelerometers, geolocation and finger based input, including gestures.
A few other details worth noting:
Adobe explicitly does not encourage the use of Flex to build iPhone apps, at least not the version of Flex you’re used to. There’s a mobile Flex Framework under development that might be of interest but it doesn’t seem to support iPhone development at this time.
iPhone Flash apps can load external SWF files dynamically, but only those that contain no Actionscript, since there’s no Actionscript virtual machine to execute the code.
iPhone Flash apps will not play video, at least not H.264 encoded video and presumably not FLV video. This strikes me as quite an opportunity for Apple, as video is one of the primary drivers of Flash adoption. If the native Quicktime player could play FLV contained video (Perian has proven it’s possible, licensing notwithstanding) it would obviate the need for a lot of what people want from Flash without forcing publishers to reconfigure their encoding and delivery pipeline.
As best I can tell, this is the first and only way to publish iPhone apps from Windows.
But those are all technical details, the heart of the matter is whether this is a good idea. The consensus amongst iPhone developers appears to be a rather decided “no” based largely on speculation and a rather warranted skepticism that Adobe can actually pull this off. I’m generally inclined to agree, based on nothing more than my own preconceptions and prejudices, that this is a poor choice for just building native iPhone apps.
However, as someone who manages a team of 5 rather sharp web developers with a great deal of Flash experience, who are also doing more mobile development, iPhone Flash apps are certainly intriguing. If your team has been following object oriented coding standards, building a mobile version of a complex, data-driven Flash visualization, for instance, shouldn’t be much more difficult than building another view and then optimizing for the mobile screen and processor.
At this point, I do not think this should be considered a viable alternative to using the official SDK. In much the same way that the myriad AIR based Twitter clients pale in comparison to Tweetie for OS X, an iPhone Twitter client built in Flash will never compete with the polish and joy of Birdfeed.
[1] Since I don’t talk about the day job much around these parts, I manage a team of incredibly talented journalists, developers and designers who build web apps for a large news website. Which news website? A major one.
[2] If you’re thinking that this portends a future free of virtual machines, runtime environments and platform specific code, I’m afraid that task would be rather impossible. Targeting the iPhone, even in this limited fashion, is most certainly hard; add Windows, Linux and OS X you’ve certainly asked for impossible.