Loading External SWF with Packager for iPhone
This is not a very technical post but one to show that it is possible to load SWFs in iOS applications. Any actionscript in the SWF will not execute, my example is just a simple animated SWF. In this code example I have one SWF with a animated vector over 20 frames. I published it and put it next to my local project to be packaged up in the ipa and also put a copy on at renaun.com to test loading remotely.
Here is the source files on github.
Here is the application test file that loads an animated SWF called
public class PFIExternalSWFTest extends Sprite
public function PFIExternalSWFTest()
private var loaderLocal:Loader;
private var loaderRemote:Loader;
private function init():void
loaderLocal = new Loader();
loaderLocal.x = 10;
loaderLocal.y = 10;
loaderRemote = new Loader();
loaderRemote.x = 60;
loaderRemote.y = 60;
Make sure to include the SWF file in the PFI’s command arguments to bundle it with the ipa.