문제

i am using this code to play my animation using my keyboard, but for some reason i dont understand, i need to click on the stage first to make it work whe it should work automaticaly, can anyone help me to fix this please?

var collage

collage=0

function gocollage1(e:KeyboardEvent):void

{

if (collage==0 && e.keyCode == Keyboard.RIGHT)

{

collage=1

myanimation.play();

}

}

stage.addEventListener(KeyboardEvent.KEY_DOWN, gocollage1);

도움이 되었습니까?

해결책

If you want to set the swf focus to the stage.

stage.focus = stage;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top