How to reconcile the path to an external swf, in a mobile device package vs Flash Pro?
Hi,
I am running into a small, convenience issue.
In my iOS AIR app, I am loading an external swf which has been included into the root of the ipa, via adt.
The code is :
var loader:Loader = new Loader();
var url:URLRequest = new URLRequest( "SoundLib.swf" );
var loaderContext:LoaderContext = new LoaderContext( false, ApplicationDomain.currentDomain, null
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onSoundLibLoadComplete, false, 0, true );
loader.load( url, loaderContext );
The swf loads just fine on the device, and I am able to instantiate the sound assets within it. So far so good.
My issue is that when compiling the main swf in Flash Pro, I am forced to use the absolute path to where the external swf is located on my desktop drive ( C:/projectName/fla/common/SoundLib.swf ). If I just use "SoundLib.swf" ( even if I include the swf via the publish settings window), or if I use a relative path ( "../common/SoundLib.swf" ) to where the main swf gets compiled to, it just doesn't find it.
I would like to avoid having to update the path to the external swf ( SoundLib.swf ), manually, whenever I compile the swf candidate for the device, as opposed to when I am merely testing the swf in Flash Pro on the desktop.
Is there a way to do that? Can the main swf recognize if it is run on the desktop , as opposed to on the mobile device?
