well, to see if a key is pressed, you need to check the key's keycode first.
so, first off, use a trace, like this.
ActionScript Code:
trace(Key.getCode());
Then test your movie and press the T-key for instance. The output window will show what keycode the T-key has.
After that, use this code.
ActionScript Code:
if(Key.isDown(78)){// 78 being the code of the key that you want people to press, so change it with the code you got from the tracegotoAndStop("TOOLS MENU 01");
}
Does this work in Projector? (I am making this a standalone movie)
I tried what you said, but it doesn't seem to get the code...unless that TRACE needs to be on frame 1 or something.
Thanks agian,
Jeff
(Here is the error Code)
**Error** Scene=Scene 1, layer=Tools Button, frame=1:Line 2: Statement must appear within on handler
if(Key.isDown(78)){ // 78 being the code of the key that you want people to press, so change it with the code you got from the trace
Total ActionScript Errors: 1 Reported Errors: 1
Last edited by crazylegsmurphy; 02-24-2005 at 08:45 PM.
Reason: More info
To click the button you just use the on(release) event which you already mentioned in your first post.
For the keypresses you just add the code I added earlier to an empty movieclip anywhere on the stage.
ActionScript Code:
onClipEvent(enterframe){if(Key.isDown(78)){// 78 being the code of the key that you want people to press, so change it with the code you got from the tracegotoAndStop("TOOLS MENU 01");
}}