I have a swf that loads two other embedded swfs. The need for an air native extension came up so I've wrapped this swf inside of an AIR app. I install my app as a native installer. (on Windows 7)
My app has a main menu screen and two buttons that will load two separate swfs to do their own menus and actions.
Everything has worked great, until I tried to install the AIR app on a computer without internet. I ran the air redistributable, then installed my app. The main menu runs fine, and the main swf can load one of the embedded swfs, but when it tries to load the second embedded swf it crashes to desktop. No warnings, no errors, I just see desktop after clicking a button.
Here is how I'm loading the offending swf:
Inside MM_DocumentClass.as
[Embed(source="../../ContentViewer/bin/ContentViewer.swf")]
public var CViewSwfClass:Class;
public var CViewMC:MovieClip;
Inside MMState_MainMenu.as
//Load the CView.swf, and add the listener for when it's done loading.
public function CView_BtnClick(e:Event)
{
Globals.stage.removeEventListener(KeyboardEvent.KEY_DOWN, Globals.keyPressHandler);
menuMC.removeEventListener("Animation_Complete", CView_BtnClick);
trace(this + "******************************************************");
trace(this + "Loading ContentView.swf");
mStateManager.Container.CViewMC = new mStateManager.Container.CViewSwfClass();
mStateManager.Container.CViewMC.addEventListener(Event.COMPLETE, onCviewLoad);
mStateManager.ChangeState(new MMState_Empty());
}
//Called when CView.swf is done loading
private function onCviewLoad(e:Event)
{
trace(this + "Cview Loaded");
mStateManager.Container.addChild(mStateManager.Container.CViewMC);
}
I load the other swf in the exact same way.
This problem can be fixed by connecting the computer to internet and trying to run the same actions. The program will pause for a second, during this time I see a visible loading icon in the middle of the screen, then it successfully loads the swf and everything works fine.
My problem is that I can't guarantee our clients will have internet at all, so I need a solution to install AIR without internet and include whatever it is that my app needs to run.
Any ideas? 'Cause this one's had me stumped for quite awhile.