package { import flash.display.Sprite; import flash.text.*; import flash.events.Event; import flash.events.TextEvent; import flash.events.MouseEvent; public class TextInputExample extends Sprite { private var myTextBox1:TextField = new TextField(); private var myTextBox2:TextField = new TextField(); public function TextInputExample() { myTextBox1.type = TextFieldType.INPUT; myTextBox1.width = 200; myTextBox1.height = 20; myTextBox1.background = true; myTextBox1.border = true; myTextBox2.x=220; addChild(myTextBox1); addChild(myTextBox2); myTextBox1.addEventListener(TextEvent.TEXT_INPUT,textInputHandler); } public function textInputHandler(event:TextEvent):void { myTextBox2.text=event.text; } } }
package; //import flash.text.TextField; import flash.display.Sprite; import flash.text.*; import flash.events.Event; import flash.events.TextEvent; import flash.events.MouseEvent; class Main extends Sprite { private var myTextBox1 : TextField = new TextField(); private var myTextBox2 : TextField = new TextField(); public function new() { super(); myTextBox1.type = TextFieldType.INPUT; myTextBox1.width = 200; myTextBox1.height = 20; myTextBox1.background = true; myTextBox1.border = true; myTextBox2.x = 220; myTextBox2.border = true; addChild(myTextBox1); addChild(myTextBox2); myTextBox1.addEventListener(TextEvent.TEXT_INPUT, textInputHandler); } public function textInputHandler(event : TextEvent) : Void { myTextBox2.text = event.text; } }
Flash html5 html5は文字入力出来ない... fukuokahaxe / Haxe勉強会 / wiki / Haxe資料 / OpenFL / HTML5 — Bitbucket