-
I have an icon and U dont!
[help] Add a loaded swf to ALL instances of a target MC?
I'm trying to emulate shared Asset functionality in AS3.![Crazy](images/smilies/18_crazy.gif)
This is what I have so far...
I have 2 mc's:
The first is inside of assetLib.swf , and is named Symbol1 it has been set to export for Actionscript.
My second target mc is called target_mc. it is local inside of my main.swf, it has also been set to export for actionscript. Now if I have 40 placed instances of target_mc in my main.swf, how do I load Symbol1 into the Library instance of target_mc so that it exists in all placed instances of target_mc?
The following code loads the library symbol into a NEW instance of target_mc, but doesn't affect existing instances, I need it to add the loaded symbol to ALL target instances.
(And please don't say "enumerate through all the target instances" because in this particular project, I'm dealing with 1000's of assets, so it's not a practical solution.)
thanks for looking,
-J
PHP Code:
var req:URLRequest = new URLRequest("assetLib.swf"); var context:LoaderContext = new LoaderContext(); context.applicationDomain = ApplicationDomain.currentDomain;
function loaded(e:Event){ var targ = new target_mc(); // this creates a new single target var imported_mc = e.target.applicationDomain.getDefinition("Symbol1"); var newAsset = targ.addChild(new imported_mc()); // adds new symbol to target addChild(s);// adds target to stage }
var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded); loader.load(req,context);
Last edited by johnwun; 06-19-2009 at 03:50 PM.
[a.fun>b.fun ? trace("do(a)") : trace("do(b)");
wundes.com
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|