;

PDA

Click to See Complete Forum and Search --> : adding movie clip with array.


flipone
03-27-2009, 10:07 PM
I have a function shuffling a array of numbers.

How can I have each number correspond to a movieclip?

Like if I have the number 4 comup first in my array, how can I have movieClip4 show up onto the screen?

cancerinform
03-28-2009, 11:04 AM
import flash.utils.getDefinitionByName;
var myArray:Array=new Array(1,4,2,5);
var MyClass:Class=getDefinitionByName("movieClip"+myArray[1]) as Class;
var mc:MovieClip = new MyClass();
addChild(mc);