PDA

View Full Version : Quick question on hitTest....



Gwocker
August 24th, 2003, 11:31 PM
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...

kode
August 25th, 2003, 12:08 AM
Welcome to kirupa forum, Gwocker! =)

Could you post your code so I can see what's wrong? :)

Gwocker
August 25th, 2003, 12:37 AM
onClipEvent (load) {
if (_root.lan, hitTest(_root.enemy1)) {
gotoAndPlay (3);
}
}
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.

kode
August 25th, 2003, 12:40 AM
Try this one... ;)
onClipEvent (load) {
if (_root.lan.hitTest(_root.enemy1)) {
gotoAndPlay(3);
}
}
I edited your post to format the code properly, you can do this by using tags. Please use them next time, thank you. =)

Gwocker
August 25th, 2003, 12:50 AM
Thanks, but there's still a problem.. the code still doesn't work >.<. Any other suggestions you think might help?

rysolag
August 25th, 2003, 12:59 AM
use enterFrame instead of load for the clipEvent

kode
August 25th, 2003, 01:00 AM
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. :P
onClipEvent (load) {
if (_root.lan.hitTest(_root.enemy1)) {
_root.gotoAndPlay(3);
}
}
So true, rysolag! How could I not see it!? :P