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
specifically Ted, but more people need to learn how to read the
documentation.


On Tue, Jun 15, 2010 at 9:28 AM, Lehr, Theodore
<ted_l...@federal.dell.com>wrote:

> I am loading a swf via something like:
>
> var loader:Loader = new Loader();
>
> function startLoad(dfile:String)
> {
>   var nRequest:URLRequest = new URLRequest(dfile);
>   loader.contentLoaderInfo.addEventListener(Evenet.COMPLETE.onComplete);
>   loader.load(nRequest);
> }
>
> function onComplete(loadEvent:Event):void
> {
>   addChild(loadEvent.currentTarget.content);
> }
>
> startLoad("some.swf");
>
> I want to be able to name the swf that gets loaded... right now it is just
> getting a random name like: instance77
>
> How can I name it?
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to