-
KeyPress
What is wrong with this keyPress command?
Code:
def.onEnterFrame = function(){
x4 = this._x
y4 = this._y
y5 = y4
x5 = x4
x5 += 46
y5 += 40
y4 -= 40
if ((((guy._x > x4) && (((guy._y > y4)) && ((guy._x < x5))) && (guy._y < y5)))) {
if (keyPress "1") {
def.play();
}
}
};
dont mind the part in bold its a substitute for a hitTest command.
-
Actionscript Developer
Wrong syntax.
Try this:
if (Key.isDown(<KEYCODE FOR 1 (you might have to look it up)> ))
{
def.play();
}
Btw, you might want to do onClipEvent(keyDown) instead of enterFrame.
-Danny
K2xL - My games, tutorials, message boards, and experiments.
Blog
-
i figured it out by putting it in a button kthxbi
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|