Gustavo,
Unlike AS2, in AS3 loading external clips into MovieClips does not add
the MovieClip's children/properties to the root of the containing MC.
Also, you are essentially adding a Loader component, instead of a
MovieClip, you probably want to do loader.content instead (which isn't
populated until the COMPLETE event is fired). So it would be something
like this:
var loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.load(new URLRequest("myswf.swf"));
function completeHandler(e:Event):void{
var newMC:MovieClip = MovieClip(loader.content);
stage.addChild(newMC);
newMC.closing.buttonMode=true;
}
Something like that should work.
On Tue, Mar 17, 2009 at 12:19 PM, Gustavo Duenas
<[email protected]> wrote:
>
>
>
> Hi coders, I have a externally loaded swf which loads inside a movie clip
> but I don't know how to instruct the button inside of the loade swf to have
> eventlisteners, anyone knows?
>
> this is pretty much my code:
>
> function creatis(e:MouseEvent):void{
>
> var newMC:MovieClip = new MovieClip();
> var newLoader:Loader = new Loader();
> newLoader.load(new URLRequest("myswf.swf"));
> newMC.addChild(newLoader);
> //so far here it loads.
> stage.addChild(newMC);
> //so far we have the swf in the stage
>
> newMC.closing.buttonMode=true;
> //here it says that a elemtn doesn't have a property and is undefined, but
> is inside the external swf, exist the movieclip closing
>
>
> }
>
> here it is, I hope you could help me out, I've been hours with this.
>
> regards,
>
>
> Gustavo
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders