The following example shows how you can create an uneditable Flash ActionScript 3.0 TextInput control by setting the Boolean editable 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 = "editable";
checkBox.selected = true;
checkBox.addEventListener(Event.CHANGE, checkBox_change);
checkBox.move(10, 10);
addChild(checkBox);
 
var textInput:TextInput = new TextInput();
textInput.editable = checkBox.selected;
textInput.width = 300;
textInput.move(10, 40);
addChild(textInput);
 
function checkBox_change(evt:Event):void {
    textInput.editable = checkBox.selected;
}
Tagged with:
 

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Spam Protection by WP-SpamFree