-
Duplicated movie will not 'removeMovieClip'
It's actually the root movie that won't go away. All duplicated 'enemies' explode, but the root character will not die. Here's enemy code:
onClipEvent(load) {
this._x-=random(150);
moveSpeed=random(3)+2;
}
onClipEvent(enterFrame) {
this._x-=moveSpeed;
if(random(11)==4) {
this.gotoAndPlay(7);
}
}
and the control that duplicates it:
for (i=1; i<=3; i++){
fish.duplicateMovieClip( "fish"+i, i+100 );
}
stop();
Also the game is posted on my site for preview purposes:
http://calingtondesigns.com/game.htm
Probably something simple, but it's had me stumped for a long time.
-
Senior Member
removeMovieClip only works on clips created with a depth >= 0,
since clips created by hand in the flash authoring program are assigned to negative depths in order to remove one of these clips with removeMovieClip you need to first use swapDepths on it,
fish.swapDepths(9999); // move to a positive depth
fish.removeMovieClip(); // now it can be removed
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|