removeMovieClip help!!?!!
- JeremysFilms
-
JeremysFilms
- Member since: Feb. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
I'm making an API game, and I set up a hitTest so that when one MovieClip hits the other, they both are removed. Here's the if statement I wrote:
if (enemy.hitTest(mc)) {
removeMovieClip(mc);
removeMovieClip(enemy);
}
mc is the movieclip you control, and enemy is the movieclip that follows mc.
I want them both to be removed when enemy hits mc. With the code I wrote, nothing seems to happen, as if the code is completely ignored.
Could someone PLEASE help me!!
- MJKram
-
MJKram
- Member since: May. 30, 2005
- Offline.
-
- Forum Stats
- Member
- Level 09
- Blank Slate
Try:
if (enemy.hitTest(mc)) {
mc.removeMovieClip();
enemy.removeMovieClip();
}
that should work.
well it does for me
- liam0
-
liam0
- Member since: Jul. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
removeMovieClip is a bitch.. try putting _root on the beggining of both..
I think you can't removeMovieClips that were created at the beginning of a flash, so you can remove ones that were attachMovie'd or created in an if statement (if space is pressed for example).
I have no proof though, just my suspicions. ¬¬.
- JeremysFilms
-
JeremysFilms
- Member since: Feb. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
At 7/23/05 11:48 AM, MJKram wrote: Try:
if (enemy.hitTest(mc)) {
mc.removeMovieClip();
enemy.removeMovieClip();
}
that should work.
well it does for me
Nope, it doesn't work.
PLEASE REMEMBER THAT I'M USING API, SO THE MOVIECLIPS ARE MADE DYNAMICLY!!
- JeremysFilms
-
JeremysFilms
- Member since: Feb. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
If the movieclips are both on different levels, can that effect a hitTest?
- JeremysFilms
-
JeremysFilms
- Member since: Feb. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
- liam
-
liam
- Member since: Dec. 11, 2004
- Offline.
-
- Send Private Message
- Browse All Posts (14,243)
- Block
-
- Forum Stats
- Member
- Level 22
- Blank Slate
At 7/23/05 11:55 AM, jeremysfilms wrote: If the movieclips are both on different levels, can that effect a hitTest?
What do you ean by different levels? You mean depths?
If so, then no.. you have to use different depths :P
Sup, bitches :)
- Denvish
-
Denvish
- Member since: Apr. 25, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (15,977)
- Block
-
- Forum Stats
- Member
- Level 46
- Blank Slate
At 7/23/05 11:55 AM, jeremysfilms wrote: If the movieclips are both on different levels, can that effect a hitTest?
It shouldn't. Try this:
_root.onEnterFrame=function(){
if(enemy.hitTest(mc)) {
_root.mc.removeMovieClip();
_root.enemy.removeMovieClip();
}
}
- JeremysFilms
-
JeremysFilms
- Member since: Feb. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate


