Copy link to clipboard
Copied
import flash.events.KeyboardEvent;
stop();
function movecar (event:KeyboardEvent):void{
if (event.keyCode == 37){
car.x -=5;
}
}
stage.addEventListener(KeyboardEvent.KEY_DOWN,movecar);
Copy link to clipboard
Copied
Hi.
Your code is correct.
Are you sure that the instance you're trying to move is actually called "car"?
You can set the instance name by selecting the object on stage and going to the Properties panel.
Please see the image below to see the differences between instance properties and symbol properties.
Regards,
JC
Find more inspiration, events, and resources on the new Adobe Community
Explore Now