I am trying to duplicate a movie for a bullet hole when the user clicks a button hole is sapposed to appear but its not working. here is the code I have inside my bullet hole
onClipEvent(load){
i = 0
}
onClipEvent (mouseDown) {
i++;
duplicateMovieClip(_root.bullethole, “bullethole”+i, i);
_root[“bullethole”+i]._x = _root.crosshair1._x;
_root[“bullethole”+i]._y = _root.crosshair1._y;
trace(i)
}
It duplicates but also removes previous bullet holes. This is what trace out puts
1
undefined
2
1
3
1
undefined
4
1
1
2
5
1
1
2
undefined
6
1
1
1
2
3
7
1
1
1
2
3
undefined
8
1
1
1
1
2
3
4
9
and so on
Any help?