简体   繁体   中英

AS3: Can I get MovieClip within a MovieClip from External Flash file Dynamically?

I want access MovieClips Dynamically from the external flash file. There are 5 MovieClips named Loader_1_mc, Loader_2_mc,.... Loader_5_mc like so. Each of this movieClip contain 5 movieClips by named acc_1,acc_2,...... acc_5 like. How Can I access From the swf file. i tried few steps within nested loop

accChrome["Loader_"+bInd+"_mc"].["acc_"+sVal].y = 780;

and,

accChrome["Loader_"+bInd+"_mc"]["acc_"+sVal].y = 780;

and

MovieClip(accChrome["Loader_"+bInd+"_mc"])["mask_"+sVal].y = 780;

and

accChrome["Loader_"+bInd+"_mc.mask_"+sVal].y = 780;

i wont get it.. Please Help me... Thanks in advance

Accessing Movieclips in movieclips (Stack Overflow Question)

var clipInClip:Acc; // class name is Acc in this case, but its whatever
clipInClip = ((this.Loader_1_mc as MovieClip).acc_1 as Acc);

clipInClip should properly hold acc_1 in this example. As for looping through using parts of strings, look at dthoughts post on this page... http://www.kirupa.com/forum/showthread.php?259717-eval-in-actionscript-3 (3rd post)

This isn't too great of an answer, so if you get stuck, ask!

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