質問ページ4 / 45


質問ページ4 / 45

質問ページ4/45

概要onKeyUp? が働かない
投稿者Parafla Quality
状態
カテゴリーActionScript
投稿日2010-12-24 (金) 17:56:09
バージョン1.38

質問内容

キー入力を検出するため、次のコードを試しました。

	focusEnabled = true;
	onKeyUp = function (){
		trace("onKeyUp called by "+this._name);
	};
	onSetFocus = function (dmy){
		trace("onSetFocus called by "+this._name);
	};
	onKillFocus = function (dmy){
		trace("onKillFocus called by "+this._name);
	};
	Selection.setFocus(this);

結果は「onSetFocus? called by xxx」と表示されるだけで、キー入力には何も反応が有りません。onKillFocus? も実行されていないので、フォーカスは保持したままだと思います。

何故、キー入力に反応しないのでしょうか? onKeyUp? の使い方を間違えているのでしょうか?

回答