AS Halp

Started by: Raffi | Replies: 4 | Views: 415 | Closed

Raffi
2

Posts: 4,326
Joined: Aug 2006
Rep: 10

View Profile
May 6, 2008 5:21 PM #130309
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?
Chimaera
2

Posts: 2,490
Joined: Oct 2005
Rep: 10

View Profile
May 6, 2008 7:52 PM #130377
Fixed:

onClipEvent(enterFrame){
if(_root.DOOR NAME.hitTest(_root.PLAYER NAME)){
_root.gotoAndStop(FRAME NUMBER);
}
}


I believe that should work.
AS2.
darkcampainger
2

Posts: 159
Joined: Aug 2006
Rep: 10

View Profile
May 6, 2008 11:28 PM #130522
Change "onClipEvent (load)" to "onClipEvent (enterFrame)"
Kitsune
2

Posts: 6,011
Joined: May 2006
Rep: 10

View Profile
May 7, 2008 2:39 AM #130722
Quote from Chimaera
Fixed:


Quote from darkcampainger
Change "onClipEvent (load)" to "onClipEvent (enterFrame)"


Helpful own!!
Raffi
2

Posts: 4,326
Joined: Aug 2006
Rep: 10

View Profile
May 7, 2008 7:21 AM #130925
Thanks guys... I try it now.

EDIT: AWESOME! it works! Thanks, Chimaera. Your name's confusing :/