I don't think this is possible, unless you actually load that asset library
from within the page1.swf's document class.
Here is how I instantiate assets from an asset library.
--------------------------
private function loadAssets():void
{
var req:URLRequest = new URLRequest( "myPath/myFile" );
var ctx:LoaderContext = new LoaderContext( false,
ApplicationDomain.currentDomain );
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener( Event.INIT, loadAssetsDone );
ldr.load( req, ctx );
}
private function loadAssetsDone( e:Event ):void
{
var assetClass:Class;
assetClass = getDefinitionByName( "myAssetClass" ) as Class;
// mAssetObj needs to be declared somewhere
mAssetObj = new assetClass();
}
--------------------------
I wonder if instead of the way I'm doing it, you were to hold onto assetClass
as a member variable of the index.swf document class, for example mAssetClass.
One thing to try would be to pass this as a parameter to your loaded
page1.swf's document class and then trying to do a new assetClass(); on it. I
have no idea if this will work, maybe you can report back.
Sorry for only being able to offer a shot in the dark. I've had a tremendous
amount of grief myself with loading swfs within swfs, and also with asset
libraries. Flash behaves in all manner of unpredictable and unintuitive ways.
One basic problem is that I don't deeply understand the concept of a
LoaderContext or the ApplicationDomain, and have not had the time to look into
it.
Arka
----- Original Message ----
From: Mike Grunwald <[EMAIL PROTECTED]>
To: Flashcoders <[email protected]>
Sent: Wednesday, July 9, 2008 2:21:18 AM
Subject: [Flashcoders] Nested SWFs
Hello all,
I'm new to AS3 and using multiple SWFs in an application. I'm used
to AS2 and 1 or 2 SWFs at max.
I'm using the GAIA framework (not sure if you're all familiar) which
seems to rock so far!, but I'm confused on a couple issues:
I have a few SWFs that load into one another (i.e., main/index/nav/
page1).
I would like to load a remote asset library into the index.swf (since
this page never unloads) and access the contents of the library from
page1.swf (and page2, page3, etc.).
I can get everything to load fine and all my movieclip classes are
accessible from the SWF that I load the remote library into.
I just can't figure out how to target them to create new instances
through the page1.swf?
Does that even make sense???
Any help would be greatly appreciated.
Thanks in advance,
_mike g.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders