I have the following, but I keep getting this error:1120: Access of undefined property keyPressed.
How do you call the variable keyPressed, which is inside another function?
function moveClip(event:Event) {
if(keyPressed = 68){
MC.x += 5;
}
}
function startAnimation(event:KeyboardEvent){
var keyPressed:Number = event.keyCode
MC.addEventListener(Event.ENTER_FRAME, moveClip);
}
stage.addEventListener(KeyboardEvent.KEY_DOWN , startAnimation)