PDA

View Full Version : where did u go hitTest?


pHrOsT
06-16-2004, 11:22 AM
ok i have an actions layer which has no keypoints that i want to use just as a "checking" layer to continously check hitTests for an MC...what is the best way to do this?...i have this but it seems that even though the code is still there after it switches frames, the code no longer is active?...ie when sam hits the bank it goes to frame "bank", but even though the code is still there it won't recognize a hit on bank_mc?


this.onEnterFrame = function() {
if (bank.hitTest(sam._x+50, sam._y+75)) {
gotoAndPlay(bank);

}
else if (bank_mc.hitTest(sam._x+50, sam._y+75)) {

trace("hit");
_root.sam.attachMovie("bank_mc", "bank_mc1", 4,{_x:-20,_y:201});
}

};

Vman
06-16-2004, 12:10 PM
So "bank" is the instance name of one of you MCs? And "sam" is the instance name of another MC? And "bank_mc" is the name of yet another MC? And when one of these guys hits another one, you want to go to a frame with the label of "bank" (which, by the way, needs to be in quotes). I think you need to post your .fla or explain in a little more detail what is supposed to be happening here. It sure would help.

pHrOsT
06-16-2004, 12:35 PM
list of MC's = sam, bank_mc and reeer

frame label = "bank"

i want the movie to skip to frame "bank" when sam hits reeer
i want bank_mc to attach to sam when sam hits bank_mc
...for some reason the movie skips to frame "bank" just fine upon hitting reeer but then fails to recognize that sam is hitting bank_mc once the movie has traveled to frame "bank"...and yes the action layer has no keypoints and thus the actions are always there...hope this helps explain things


this.onEnterFrame = function() {
if (reeer.hitTest(sam._x+50, sam._y+75))
{
gotoAndPlay(bank);
}
else if (bank_mc.hitTest(sam._x+50, sam._y+75))
{
_root.sam.attachMovie(bank_mc, "bank_mc1", 4,{_x:-20,_y:201});
}
};

Vman
06-16-2004, 01:47 PM
What movie is this code on that you have posted?