Greetings my fellow Flash users;
I am having difficulty scripting for a videogame I am creating.
I would like to utilize the duplicateMovieClip function, however I have not seen any tutorials that explain how to duplicate mc’s WITHOUT a button. I wish to use a timing function so that the movie clips are randomly created at a certain time.
Here is the code I am currently using on my first frame:
function duplicateMC (){
i = Math.random(1)*100;
i = Math.floor (1);
duplicateMovieClip(_root.my_mc, “my_mc”+i, i);
setProperty(“my_mc”+i, _x, Math.random(1)*200);
setProperty(“my_mc”+1,_y, Math.random(1)*200);
}
And the code on my_mc:
onClipEvent(enterFrame){
time = getTimer();
if(time >=1000){
duplicateMC();
}
This code has not worked in duplicating my_mc (based on time). For testing purposes I have created a button to see if I could duplicate my_mc from the button and it has worked.
Any suggestions? I am working with Flash 8 and MX 2004.