If you want to call addChild on the content then you can simply do:
addChild(event.target.content)
and that will throw your content on the stage. I'm not sure why it is not
possible to name that new content. I've tried playing around with this
myself and can't figure out how once you've loaded the content you can
access that content as a class. I've loaded up swfs and can reference
classes within the swf no problem and create instances of those classes
but if I try to get a class definition for the content all I can get is
MovieClip and I can't figure out how to create new instances of the that
loaded content without running another loader
Not sure if that helps you any or not.
Rob
On Wed, 06 Jun 2007 22:59:33 -0400, Patrick Matte|BLITZ
<[EMAIL PROTECTED]> wrote:
Is there a way a change the name of the Loader content property. I'd
like to call addChild() on the content instead of the Loader itself.
Like this :
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, loaderInit);
var request:URLRequest = new URLRequest(pageSource);
loader.load(request);
private function loaderInit(event:Event):void{
event.target.removeEventListener(Event.INIT, loaderInit);
var page:Page = event.target.content;
page.name = "test";
}
That code throws this error but I cant understand why.
Error: Error #2078: The name property of a Timeline-placed object cannot
be modified.
at flash.display::DisplayObject/set name()
at com.blitzagency.fabric::Main/::loaderInit()
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com