Flash on the iPhone hypothetical solution

Gary McGhee - Monday, November 10, 2008
It seems to me it would be possible to get Flash applications working on the iPhone now, without Adobe or Apple's cooperation.
Flash and Air apps are distributed as swf or air files containing bytecode for the Adobe Virtual Machine 2 (AVM2) (documented here) calling its APIs for graphics, window management, file system etc, and so the challenge is to execute that bytecode andimplement those libraries. iPhone apps are written in Objective C with some subset of the MacOS X libraries, and some new ones.
So my proposal is :
  1. write a translator from AVM2 bytecode to Objective C. This kind of thing has been done many times before. HotRuby takes Ruby bytecode output from the Ruby interpreter and translates to AVM2 to run a Ruby program on the Flash player.
  2. Implement the Flash and/or Air system calls (eg. play a sound, create a window, open a file) in Objective C and OS X libraries.
  3. Write a compiler to take a .air or .swf file and convert its code and assets into a form useable in Objective C/OS X.
  4. Output a fully native iPhone app, ready for upload to Apple. They don't even need to know it was written in Flash/Flex!
Issues :
  1. Apple wouldn't like it. You might even find your name blacklisted in the OS X EULA !
  2. Adobe might be OK with it. They get more Flex customers, and you become the bad guy (not them) in Apple's eyes.
If an investor wants to make this happen, I'm available !
Comments
Gary McGhee commented on 31-Jul-2009 04:53 AM
I've just discovered that the PhoneGap project http://phonegap.com/ does the cross-compiling from Javascript into Objective C, and also uses WebKit to develop iPhone apps. Now Adobe's ActionScript is a superset of Javascript, and Adobe AIR also uses WebKit, so PhoneGap development must be pretty similar to AIR development!

Post a Comment




Captcha Image

Trackback Link
http://www.buzzware.com.au/BlogRetrieve.aspx?BlogID=1956&PostID=30388&A=Trackback
Trackbacks
Post has no trackbacks.