HitTest troubles

Subscribe to HitTest troubles 6 posts

avatar for Yllier Yllier 1122 posts
Flag Post

Im having some troubles with hitTest right now. Im try to make it change frames upon hitTest. Ive tried a few different things.

onClipEvent (enterFrame) {
if (hitTest(_root.mover)==true)
{
play();
}
}

onClipEvent (enterFrame) {
if (hitTest(_root.mover)==true)
{
gotoAndStop(41);
}
}

Any help?

TL

 
avatar for Jakobsdillusion Jakobsdillusion 80 posts
Flag Post

Im pretty new to AS, but it seems you need to replace {play (); with gotoAndPlay{whatever key #}} or something along those lines

 
avatar for arcaneCoder arcaneCoder 2354 posts
Flag Post

What are your actual “troubles?”

 
avatar for Yllier Yllier 1122 posts
Flag Post

Lol my problems are nothing happens at all.

 
avatar for JudeMaverick JudeMaverick 8844 posts
Flag Post

That darn onClipEvent!

Where’s the this. or the instance name for the thing to hit mover?

 
avatar for Kalinium Kalinium 764 posts
Flag Post

As a side note, if(something==true) is the same thing as if(something).

The contents of the bracket are evaluated and if they’re true, the if is run. if(11) runs because 11 is true. if(true) runs because true is true.