Quick question on hitTest

When I use hitTest, there’s a limited number of commands I can use. For example, if I want to Go To and Play the next scene as soon as a collision is detected, I’d enter GoToandPlay yadda yadda right under the hitTest command, but when there’s a collision, nothing will happen. I’m relatively new to actionscript, so forgive me if I sound stupid, but am I doing something wrong? If I can, how would I get hitTest to go to and play another scene? Thanks in advance for any help…

Welcome to kirupa forum, Gwocker! =)

Could you post your code so I can see what’s wrong? :slight_smile:

[AS]onClipEvent (load) {
if (_root.lan, hitTest(_root.enemy1)) {
gotoAndPlay (3);
}
}[/AS]
That’s the command I’m using… And as I understand, the action should make the clip play the third frame, but nothing’s happening.

Try this one… :wink:
[AS]onClipEvent (load) {
if (_root.lan.hitTest(_root.enemy1)) {
gotoAndPlay(3);
}
}[/AS]
I edited your post to format the code properly, you can do this by using [AS][/AS] tags. Please use them next time, thank you. =)

Thanks, but there’s still a problem… the code still doesn’t work >.<. Any other suggestions you think might help?

use enterFrame instead of load for the clipEvent

Ok… it must be an addressing problem.

Althought it would be easier for me if you could attach your FLA… I’ll take a shot in the dark. :stuck_out_tongue:
[AS]onClipEvent (load) {
if (_root.lan.hitTest(_root.enemy1)) {
_root.gotoAndPlay(3);
}
}[/AS]
[EDIT]So true, rysolag! How could I not see it!? :P[/EDIT]