Can you use a variable in place of movieclip linkage for addchild?
var top:MovieClip = MovieClip(root);
| top.menu3.addChild(member[i-1].scenarioplayed); |
I want to add components to a movieclip depending on value of i.
The movieclips are named menu3, menu4, etc.
Is there a way to make all are part of "top.menu3" a variable?
I tried this but got a compile error:
| Symbol 'scene3', Layer 'Actions', Frame 1, Line 161 | 1061: Call to a possibly undefined method addChild through a reference with static type String. |
var menuName:String;
menuName = "top.menu5";
menuName.addChild(member[i-1].scenarioplayed);
