Actionscript for Duplicating
4 posters
Page 1 of 1
Actionscript for Duplicating
I'm having some problem with Actionscript for Duplicating. I wanted to make a button to duplicate a starship like Broken Mirror where you make a fleet, but when I press the button, it only duplicates one. And if pressed again the duplicated one just keeps moving around.
Help!
The code I typed in:
The swf file
SWF file
Help!
The code I typed in:
- Code:
on (release){
//keep track of how many movie clips duplicated
num_movie_clips = num_movie_clips+1
//duplicate movie clip
myMovie.duplicateMovieClip("myMovie"+num_movie_clips,num_movie_clips);
//position movie clip
_root["myMovie"+num_movie_clips]._x=Math.random()*550
_root["myMovie"+num_movie_clips]._y=Math.random()*350
}
The swf file
SWF file
Final Frontier- Ensign
- Number of posts : 301
Age : 27
Location : Where am I?
Registration date : 2010-01-10
Final Frontier- Ensign
- Number of posts : 301
Age : 27
Location : Where am I?
Registration date : 2010-01-10
Re: Actionscript for Duplicating
oooh, that's out of my league, never got that far, I was only beginning to touch on activating MCs in the AS when I stopped using flash
Re: Actionscript for Duplicating
i think your gonna want to change "num_movie_clips = num_movie_clips+1" to +2 or ++ or whatever to create more than one
Re: Actionscript for Duplicating
I did num_movie_clip ++, still doesn't work. Maybe I'll try again.
Final Frontier- Ensign
- Number of posts : 301
Age : 27
Location : Where am I?
Registration date : 2010-01-10
Re: Actionscript for Duplicating
That it's similar to java and C... weird...
Ok, lets see... may be you should check if there is any ship existent, and then use a loop cycle to keep adding +1 (until the user closes the program... or script...)
Ok, lets see... may be you should check if there is any ship existent, and then use a loop cycle to keep adding +1 (until the user closes the program... or script...)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum