Be a Supporter!

Movie Clips copy over to next frame

  • 311 Views
  • 3 Replies
New Topic Respond to this Topic
scuddle666
scuddle666
  • Member since: Dec. 25, 2008
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Movie Clips copy over to next frame 2010-03-31 05:57:56 Reply

When I have the character move from one frame to the next, IE a new level, Several MC's from the previous frame show up on the new one. Like when the frame changes to the game over screen, the enemies will fallow to the next frame, and be walking across the game over movie. I don't know how to get rid of this, Do i need to make an entire new scene for each level, Because the same happens when i have the character maybe move to a previous frame, ie to like roam the several sections of the game. Then the enemies or several other random movie clips will fallow. any help will be appreciated.
-scuddle

AdmittingZero
AdmittingZero
  • Member since: Mar. 21, 2010
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Movie Clips copy over to next frame 2010-03-31 07:01:28 Reply

You need to remove the movieclips when you're done with them.

AS2:
targetMC.removeMovieClip();

AS3:
stage.removeChild(child:MovieClip);


MSN/Email-> kevin.stubbs@live.com -Need artists!
The 9th Legion
(Looking for somebody to create the site for $$$).

scuddle666
scuddle666
  • Member since: Dec. 25, 2008
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Movie Clips copy over to next frame 2010-03-31 07:07:13 Reply

At 3/31/10 07:01 AM, AdmittingZero wrote: You need to remove the movieclips when you're done with them.

AS2:
targetMC.removeMovieClip();

AS3:
stage.removeChild(child:MovieClip);

Why is it that happens? Is there a way i can make them not fallow to the next frame? besides having to remove each enemy. and what defines, which MC's will fallow over to the next one? Will making a new scene change anything? Sorry for all the questions.

scuddle666
scuddle666
  • Member since: Dec. 25, 2008
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Movie Clips copy over to next frame 2010-03-31 07:34:59 Reply

Okay I think i got it. I didn't want to have to manually unloadmovie every time i made like a warp point. so i made this short code i put on each item.
onClipEvent(load){
assignedarea = (1,2,3,etc);
}
onClipEvent(enterFrame){
if(assignedarea == _root.area){
}else{
this.unloadMovie();
}
}
and at the beginning of each frame i just put area = (1,2,3,etc);
and WOOP! problem solved! so far it seems to be working just fine.