this has been racking my brain ive been looking all over the internet to find out what im doing wrong, im trying to control my movie with the Right and Left key, Left key to gotonext frame and Right key gotoprevious but it keeps coming up erroe about this can only be on a button instance im sure im doing something stupid but i dunt know what
That totally wrong dude.
You’ll have to add a listener to the “Key” object, which will notify you when a key is pressed.
[AS]
var myListener:Object = new Object();
myListener.onKeyDown = function () {
if (Key.isDown(Key.LEFT)) {
trace(“left key”);
}
}
Key.addListener(myListener);
[/AS]
You can use Key.LEFT, Key.RIGHT etc for the standard keys (view Help for all keys), but you can also use Key.getCode() or Key.getAscii() to get the last key pressed.
[AS]
var myListener:Object = new Object();
myListener.onKeyDown = function () {
if (Key.isDown(Key.LEFT)) {
gotoAndPlay(someNumber);
}
}
Key.addListener(myListener);
[/AS]
Cheers i thought that was the case but when i did it it didnt work, but i relived i was on the button status not the timeline silly me thanks very much for your help