<mx:Script> <![CDATA[ private function textInput_doubleClick(evt:MouseEvent):void { var ti:TextInput = evt.currentTarget as TextInput; ti.enabled = !ti.enabled; ti.editable = ti.enabled; } ]]> </mx:Script>
<mx:TextInput id="textInput1" text="The quick brown fox jumped over the lazy dog" doubleClickEnabled="true" doubleClick="textInput_doubleClick(event);"/>
<mx:TextInput id="textInput2" text="The quick brown fox jumped over the lazy dog" doubleClickEnabled="true" doubleClick="textInput_doubleClick(event);"/>
private var textInput1:TextInput; private var textInput2:TextInput;
private function init():void { textInput1 = new TextInput(); textInput1.text ="The quick brown fox jumped over the lazy dog"; textInput1.doubleClickEnabled = true; textInput1.addEventListener(MouseEvent.DOUBLE_CLICK, textInput_doubleClick); addChild(textInput1);
textInput2 = new TextInput(); textInput2.text ="The quick brown fox jumped over the lazy dog"; textInput2.doubleClickEnabled = true; textInput2.addEventListener(MouseEvent.DOUBLE_CLICK, textInput_doubleClick); addChild(textInput2); }
private function textInput_doubleClick(evt:MouseEvent):void { var ti:TextInput = evt.currentTarget as TextInput; ti.enabled = !ti.enabled; ti.editable = ti.enabled; } ]]> </mx:Script>