简体   繁体   中英

as3 accessing CHILD in External loaded swf file

How do I get to the MovieClips within an externally loaded Movie Clip.

Lets say I have a movie Called ONE in the swf I just loaded. How can I work with it alpha, position and other properties of the children of this clip?

CODE IN MAIN TIMLINE: 

    var LoadedMC:Loader = new Loader();
    LoadedMC.load(new URLRequest("amplitude.swf"));

    LoadedMC.addEventListener(Event.COMPLETE, bL);
    function bL (e:Event):void{
    addChild(LoadedMC);
}

Now its loaded I want to change the postino of the clip called ONE in the movie LoadedMC I just created.

Thanks for your help. -Ed

I would think you would do something like:

//Cast the content into a movie clip
var someMC:MovieClip = MovieClip(LoadedMC.content);
//or try
var someMC:MovieClip = LoadedMC.content as MovieClip;

//then access the child
someMC.ONE.x = 50;
someMC.ONE.y = 100;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM