all groups > flash actionscript > january 2004 >
You're in the

flash actionscript

group:

hitTest


hitTest wd40smellsgood
1/31/2004 8:54:31 PM
flash actionscript:
Hello, my name is alex, and i am sort of a "Newbie" at action script, and i was trying to creat a hit test, so that when the "Axe" hits the guys head, the guys head gets chopped off. Here is my syntax:
on (press) {
startDrag("axe");
}
on (release) {
stopDrag();
}
on (release) {
hitTest(Y_75,Y_150,X_75,X_150);
}
on (release) {
if (hitTest=True) {
gotoAndPlay(2);
}
}
wheneevr i let go of the axe when its not on his head, it still says that its true. what should i do?And what am i doing wrong?

Re:hitTest kglad
1/31/2004 10:21:37 PM
there are some problems with your code. first, that code is attached to a movieclip or button. what movieclip or button? second, are you trying to perform a hitTest between your "axe" movieclip and another movieclip (if so, what's the name of that movieclip) or between "axe" and some rectangle (if so, are the boundaries of that rectangle 75 and 150 for the both x and y) on the _root timeline?

Re:hitTest wd40smellsgood
2/1/2004 1:54:19 AM
umm like i said, i am anewbie, and half the stuff you said made no sense whatsoever. Could you please tell me simple instructions on how to make a hitTest? If so, it would be so much help. Thanks

Re:hitTest kglad
2/1/2004 7:01:08 AM
to give you specific help, you'll need to answer those questions in my message above. but in general you would use:
if(movieclip1.hitTest(movieclip2)){
//this is executed of movieclip1 and movieclip2 have a positive hitTest()
}

Re:hitTest wd40smellsgood
2/1/2004 7:12:31 PM
thanks, i think i should be able to figure the rest out, i just needed the coding of the hit test thing.

Re:hitTest kglad
2/1/2004 9:25:41 PM
you're welcome.

Re:hitTest Pea
2/22/2004 12:40:16 AM
Can I just offer some simple advice on this?
AddThis Social Bookmark Button