Once Adobe released their Flex Air which enable flash developers to create IOS (iPhone & iPad) applications, it is possible to load the swf into iPad applications. But after testing from several times, I just find out it is not so good as what I thought. First, let me explain how to load flash into iPad application which is made by Air 3.0.
As Flash developers or Flex developers, we know that actionscript 3 allows us to load the external resource such as image, or swf file by using Loader in flash, or Image and swfLoader in Flex. The latest flash cs5.5 and Flex 4.5 can also let us compile our flash applications to IOS native applications. So this is the solution to load external flash swf by iPad application, creating a IOS native application by Flash cs5.5 or Flex 4.5, which is using Loader or swfLoader to load the external swf. There is a simple code snap in Flash:
package { import flash.display.Loader; import flash.display.Sprite; import flash.net.URLRequest; public class PFIExternalSWFTest extends Sprite { public function PFIExternalSWFTest() { init(); } private var loaderLocal:Loader; private var loaderRemote:Loader; private function init():void { loaderLocal = new Loader(); loaderLocal.load(new URLRequest("ExternalAnimatedSWF.swf")); loaderLocal.x = 10; loaderLocal.y = 10; addChild(loaderLocal); loaderRemote = new Loader(); loaderRemote.load(new URLRequest("http://renaun.com/flex4/ExternalAnimatedSWF.swf")); loaderRemote.x = 60; loaderRemote.y = 60; addChild(loaderRemote); } } }
Now let’s talk about what disappoint me a lot after I have several testing. In the native application what we create above, it works well to load a swf. But the swf must be a simple pure swf without any actionscript code inside, even for “stop()”, which means only the pure frame animation swf will work in this iPad applications. And it is totally useless because who will create such swf file without any actionscript code. I’m afraid that it’s time to shift to Html 5, Java or Object C programming, even Adobe itself already gave up the mobile browser flash player development.
Man, this is disappointing. But not entirely unpredictable. Apple have been bastards to deal with through this entire convoluted process. I’ve used apple computers for years and have, up until the past 6 months or so had a pretty positive impression of the company – but they are quickly losing me.
It amazes me as I transfer from developing touch screen apps to iOS apps how complicated the simple processes have become. For example, debugging a test application on an iPad has easily become a multi-hour process when it used to be just hitting a few keys. My business in response is having to charge nearly twice the cost to develop for iPad over any device just to compensate for this radical hoop jumping Apple requires.
Apple claims they do not want external swfs on applications due to security concerns. How bad does your security have to be to where your device can’t block simple flash content? Apple should just come forward and be honest with developers:
“We’re blocking external swfs because it is the best way to develop in flash/flex and we want to cripple that platform. We want to own the entire development platform so we can decide what content we can censor from the populace and how much it costs to make that content.”