AS Halp
Started by: Raffi | Replies: 4 | Views: 415 | Closed
Raffi2Posts: 4,326
Joined: Aug 2006
Rep: 10
View Profile I'm making a little game where you have to get to a door and you go to the next level. It's a platformer. Here's the problem.
onClipEvent (load) {
if (this.hitTest (_root.door)) {
_root.gotoAndStop (3);
}
}
Whenever the player hits the door, nothing happens. I checked the Instance Name isn't misspelt, and the coding isn't misspelt either, so can anyone help?
Chimaera2Posts: 2,490
Joined: Oct 2005
Rep: 10
View Profile Fixed:
onClipEvent(enterFrame){
if(_root.DOOR NAME.hitTest(_root.PLAYER NAME)){
_root.gotoAndStop(FRAME NUMBER);
}
}
I believe that should work.
AS2.
darkcampainger2Posts: 159
Joined: Aug 2006
Rep: 10
View Profile Change "onClipEvent (load)" to "onClipEvent (enterFrame)"
Kitsune2Posts: 6,011
Joined: May 2006
Rep: 10
View Profile Fixed:
Change "onClipEvent (load)" to "onClipEvent (enterFrame)"
Helpful own!!
Raffi2Posts: 4,326
Joined: Aug 2006
Rep: 10
View Profile Thanks guys... I try it now.
EDIT: AWESOME! it works! Thanks, Chimaera. Your name's confusing :/