I’m having some trouble trying to duplicate movieclips randomly. I have created an array with the instance names of the MCs i have on stage. Then I’m trying to create a variable that selects one random element from the array. Finally I want to use that variable as a target to duplicate my movie Clips… but it doesn’t work.
Here is the code:
var Items = new Array('bombon', 'regalo', 'corazon');
pos = new Object();
pos._x=random(550);
i=0
function randomize (){
targeta=Items[random(3)]
targeta.duplicateMovieClip("item"+i,i,pos);
i++;
}
var Int = setInterval(randomize, 10);