Flash: Adjust this code to keep the duplicated movie clip
- by Luke Evans
OK, so here is my code
ham_mc.onPress=function(){
startDrag(this);
}
ham_mc.onRelease=ham_mc.onReleaseOutside=function(){
stopDrag();
_root.ham_mc.duplicateMovieClip("ham_mc" + "x",2);
x++;
}
The user can at first drag the movie clip. When released, the duplicateMovieClip command runs, leaving a new ham movie clip in the position the first is dragged to.
PROBLEM: When I click and drag the first ham movie click again, the duplicateMovieClip runs again but REPLACES the previous generated movie clip.
I added x and x++ in an attempt to give the movie clip duplication a different name every time, but this doesn't solve it.
How do I change this code so that a NEW ham_mc is created every time, rather than overwriting the old one. I'm tired, sorry for the poor explaination!