Re: [Flashcoders] Naming a loaded swf

2010-06-15 Thread Ktu
Loader.content is a DisplayObject. DisplayObject have a .name property function onComplete(loadEvent:Event):void { var loadedContent = loadEvent.target.content; loadedContent.name = MyName; addChild(loadedContent); } Ktu P.S. this is all right in as3 livedocs... Not that this is for you

Re: [Flashcoders] Naming a loaded swf

2010-06-15 Thread Glen Pike
Cast it to a DisplayObject then give that a name? var obj:DisplayObject = loadEvent.currentTarget as DisplayObject; obj.name = my instance; ... On 15/06/2010 14:28, Lehr, Theodore wrote: I am loading a swf via something like: var loader:Loader = new Loader(); function

Re: [Flashcoders] Naming a loaded swf

2010-06-15 Thread Ktu
There is no need to cast. The Loader.content property is defined as a DisplayObject - http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/Loader.html#content but I should have been more strictly typed. function onComplete(loadEvent:Event):void { var loadedContent:DisplayObject =

RE: [Flashcoders] Naming a loaded swf

2010-06-15 Thread Lehr, Theodore
...@cataclysmicrewind.com] Sent: Tuesday, June 15, 2010 9:49 AM To: Flash Coders List Subject: Re: [Flashcoders] Naming a loaded swf There is no need to cast. The Loader.content property is defined as a DisplayObject - http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/Loader.html#content but I

Re: [Flashcoders] Naming a loaded swf

2010-06-15 Thread Ktu
...@chattyfig.figleaf.com [ flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Ktu [ ktu_fl...@cataclysmicrewind.com] Sent: Tuesday, June 15, 2010 9:49 AM To: Flash Coders List Subject: Re: [Flashcoders] Naming a loaded swf There is no need to cast. The Loader.content property is defined

Re: [Flashcoders] Naming a loaded swf

2010-06-15 Thread Glen Pike
cannot be modified From: flashcoders-boun...@chattyfig.figleaf.com [flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Ktu [ktu_fl...@cataclysmicrewind.com] Sent: Tuesday, June 15, 2010 9:49 AM To: Flash Coders List Subject: Re: [Flashcoders] Naming

RE: [Flashcoders] Naming a loaded swf

2010-06-15 Thread Lehr, Theodore
...@chattyfig.figleaf.com [ flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Ktu [ ktu_fl...@cataclysmicrewind.com] Sent: Tuesday, June 15, 2010 9:49 AM To: Flash Coders List Subject: Re: [Flashcoders] Naming a loaded swf There is no need to cast. The Loader.content property is defined

RE: [Flashcoders] Naming a loaded swf

2010-06-15 Thread Lehr, Theodore
List Subject: Re: [Flashcoders] Naming a loaded swf There is no need to cast. The Loader.content property is defined as a DisplayObject - http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/Loader.html#content but I should have been more strictly typed. function onComplete