이제 반복을 중지하기 위해 키보드 이벤트를 작성하려고합니다.as3에서 반복되는 키보드 작동 중지 이벤트 사용 안 함
내 생각은 키를 눌렀을 때 true 및 false 조건을 사용하여 키가 이미 내려져 있으면 반복하지 않게하는 것이 었습니다.
//Mouse Event Over
keyCButton.addEventListener(MouseEvent.MOUSE_OVER, function(){gotoAndStop(2)});
//Variable
var Qkey:uint = 81;
//Key Down Event
stage.addEventListener(KeyboardEvent.KEY_DOWN, keydown);
var soundplayed = false;
function keydown(event:KeyboardEvent){
if (event.keyCode==Qkey) {
this.soundplayed=true;
}
}
if (this.soundplayed==false){
gotoAndPlay(3);
}
//Key Up Event
stage.addEventListener(KeyboardEvent.KEY_UP, keyup);
function keyup(event:KeyboardEvent){
this.soundplayed=false;
gotoAndStop(1);
}
이 키보드 내가 추가 할 필요가 있다고 생각 이벤트는 "& &를 keyDown ..."에서 "만약 (this.soundplayed == true)가"하지만 난없이 반복 키 루프를하게하고 점점 오류 여기
없이 작업을 수행하는 방법을 잘 모릅니다 키보드 플레이어는 난 .. 난 당신이 이러한 프레임에 무엇을하는지 확실하지 않다 http://soulseekrecords.org/psysci/animation/piano.html
고맙습니다. –