Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Doors to other rooms.

Status
Not open for further replies.

Samppu

Programmer
Aug 31, 2008
1
0
0
FI
Hi, Im newbie with the flash, but Im using ActionScript 2.0, and I have a moving character. Im training with making a little game, but I can't make the character to move to other rooms with doors. Im making system like when character are under the invicible object and down-key is pressed down, the character will move to another frame (in this case frame 2). I was make a system, and I was set the "door" to button, but this system wasn't work:
(This is the door's action)
onClipEvent(enterFrame){
if (Key.isDown(Key.SPACE)) {
if(this.hitTest(_root.man)){
gotoAndStop(2)
}
}
}

And I know, it's for movie clip. Then I was make a new code for the door:

(This is the door's action)
on (keyPress "<Down>") {
if(this.hitTest(_root.man)){
gotoAndStop(2)
}
}

And that doesn't give me a error, but I can move with that code to other frame when I wasn't under the door object, and I wan't to make like when im under the door, the _root.man will go to other room.

I hope somebody can tell me how to make like what im searching: when the man is under/over the "button" door, and key down are pressed down the frame will change to frame 2.

Sorry my bad english, but I living in Finland, and I was learn the english in school :) '

-Samppu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top