PDA

View Full Version : problem - can i add certain key presses with a hittest



patricktheking
August 28th, 2004, 03:33 PM
hey i have a question.... can u create something where if the main mc is on a certain ground or something, if enter is pressed the game will go to the next scene..
I tryed attacking this to the piece of ground in which i would like this to occur but with no luck

onClipEvent (enterFrame) {
if (this.hitTest(_root.man)) {
if (Key.isDown(Key.ENTER)) {
gotoAndPlay(2);
}
}

it doesnt work for some reason... i tryed this as well

onClipEvent (enterFrame) {
if (this.hitTest_root.man) {
if (Key.isDown.Key.ENTER) {
gotoAndStop(2);
}
}
}

any ideas why...

Skribble
August 28th, 2004, 03:45 PM
onClipEvent (enterFrame) {
if (this.hitTest(_root.man) && Key.isDown(Key.ENTER)) {
_root.gotoAndPlay(2);
}
}

patricktheking
August 28th, 2004, 08:24 PM
thank u