FLASHでゲームを作ろうと思ってる。
必要な要素をテストで確かめておく。まずは、テキストボックスに文字入力し、ENTERで確定するような処理を想定。
適当にテキストボックス(テキスト入力)を配置して、プロパティタブの「変数」に”hoge”と入力。そのテキストボックスをインスタンス化(ムービークリップ)して、次のActionScriptを貼り付ける。
サンプル実行するときにテキストボックス位置が透明で見分けが付かないので目印を置いておくと良い。
1 2 3 4 5 6 7 8 9 |
onClipEvent (enterFrame) { if (Key.isDown(Key.ENTER)) { if( hoge != "" ) { hoge_save = hoge; trace(hoge_save); hoge = ""; // 見た目はENTERでクリアされるように } } } |
No comments yet. You should be kind and add one!
By submitting a comment you grant typista a perpetual license to reproduce your words and name/web site in attribution. Inappropriate and irrelevant comments will be removed at an admin’s discretion. Your email is used for verification purposes only, it will never be shared.