flash - AS3 add movie clip to stage using variable which holds the MC name -


i know how add movie clip stage library i'm strugling when need load movie clip library when name of movie clip held in variable.

for(var i:number = 0; < 64; i++) {     var blueicons:blueicon = new blueicon();     addchild(blueicons);     blueicons.x = 100;     blueicons.y = 100; } 

the above code works adding blueicon have variable in loop tells icon load.

sectorsmcs[jewelsids[i]] 

the above tell me mc name load how load mc library variable value?

you may have link movieclip specific class following work...

 var mcname:string = sectorsmcs[jewelsids[i]];  var classname:object = getdefinitionbyname(mcname);  var mc:movieclip = new classname(); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -