The following example shows how you can enable or disable a Flash ActionScript 3.0 TextInput control by setting the Boolean enabled property.
Full code after the jump.
// ActionScript 3.0 /* Requires: * - CheckBox component in Flash library * - TextInput component in Flash library */ import fl.controls.CheckBox; import fl.controls.TextInput; var checkBox:CheckBox = new CheckBox(); checkBox.label = "enabled"; checkBox.selected = true; checkBox.addEventListener(Event.CHANGE, checkBox_change); checkBox.move(10, 10); addChild(checkBox); var textInput:TextInput = new TextInput(); textInput.text = new Date().toString(); textInput.enabled = checkBox.selected; textInput.width = 300; textInput.move(10, 40); addChild(textInput); function checkBox_change(evt:Event):void { textInput.enabled = checkBox.selected; }
6 Responses to Disabling a TextInput component in Flash using ActionScript 3.0
Leave a Reply Cancel reply
Recent Posts
- Getting started with the TLFTextField class in ActionScript 3.0 and Flash CS5
- Adding tick marks to a Slider control in Flash using ActionScript 3.0
- Creating a vertical Slider control in Flash using ActionScript 3.0
- Creating a custom context menu item in Flash using ActionScript 3.0
- Rotating a Sprite object around its x-axis in Flash using ActionScript 3.0 and Flash Player 10
- Detecting when the user changes the color in a ColorPicker control in Flash using ActionScript 3.0
- Getting the currently selected color as a hexadecimal value on a ColorPicker control in Flash using ActionScript 3.0
- Toggling the text field on the ColorPicker control in Flash using ActionScript 3.0
- Creating a vertical Slider control in Flash using ActionScript 3.0
- Setting the number of columns on a ColorPicker control in Flash using ActionScript 3.0
Categories
- Bitmap (1)
- Components (72)
- Button (19)
- CheckBox (2)
- ColorPicker (6)
- ComboBox (1)
- DataGrid (8)
- FLVPlayback (7)
- Label (9)
- ProgressBar (2)
- Slider (3)
- TextArea (1)
- TextInput (7)
- UILoader (7)
- ContextMenu (1)
- Embed (4)
- ExternalInterface (2)
- Flex (7)
- Font (2)
- General (5)
- Graphics (2)
- JSFL (14)
- Loader (3)
- LoadVars (3)
- Microphone (1)
- migration (12)
- MovieClip (1)
- MovieClipLoader (1)
- Sound (2)
- TextField (1)
- TLFTextField (1)
- TransitionManager (1)
- Tween (1)
- Uncategorized (1)
- URLLoader (4)
- URLVariables (1)
- Video (1)
- XML (2)
Advertising
" RT @OReillyMedia: #Ebook Deal/Day: Learning JavaScript Design Patterns -
$11.99
(Save 50%)
http://t.co/ilcmSDv6 " — pdehaan


May I ask you a question?
besides Flex components & TextLayout Components & fl Components
If any component can support “keyboard input”?
Like flash.text.TextField;
If no , how “adobe text layout frame” create a TextInput ?
Thanks a lot^^;
purplewind,
The flash.text.TextField supports text input, you just need to set the
typeproperty to “input” (or use the static TextFieldType.INPUT constant).Flash Player 10 also added the Text Layout Framework (TLF) classes, as well as the native Flash Text Engine (FTE) classes. For more information, check out the beta Flex Gumbo docs at http://livedocs.adobe.com/flex/gumbo/langref/
Peter
Thank you, Peter^^
I knew TextField can support Input.
But in the environment of Flash Player 10,
I’m using the FTE , so I need an original Input component that will not increase swf’s size.
Of course I could use the TextField class simply
But I have something that baffles.
If there is no other original Input componet.
How TLF support textinput ?
TLF used a TextField for its input action ?
I have read all FTE classe scarefully. .
But I haven’t found a class like that .
Sorry, the Text Layout Framework (TLF) was an add-on, not actually shipped WITH Flash Player 10 (my first email was a bit vague).
For more information on the TLF project, check out the TLF page on the Adobe Labs site http://labs.adobe.com/technologies/textlayout/ and the TLF team’s blog at http://blogs.adobe.com/tlf/.
As far as I know (and I could be wrong) TLF is built on top of FTE, so it uses the FTE classes and adds its own additional functionality.
Peter
Yestday I read some about IME
I think a input component may used it .
TLF built on top of FTE , yes.
But I afraid that TLF components & Flex components will let
a swf file with more then “400Kb”.
So , if could develop a lightweight text frame with FTE , then I can control my
swf file size in “20Kb”.
Thank you for your help.^^