Home | Contact Us | Store

Flash TextInput Component and Label Component ActionScript 3 Tutorial

This Flash Component tutorial series show how to use TextInput and Label with Flash ActionScript 3.

Flash ActionScript component control tutorial example display here. Your flash player version is too old to see this Flash tutorial example!

Flash Tutorial Content:

The Flash TextInput component allow users to input text while Flash Label component usually use to display some information.

The finished Flash Movie of this tutorial is shown as above. Click on the above Flash Movie and play around.

Flash ActionScript Codes:

//Set the Normal RadioButton to be selected by default
normal_rb.selected = true;

//Declare the Radio group (belong to same group)
//This can be done by using the first RadioButton (normal_rb)
var textCaseGroup:Object = normal_rb.group;

//Listen to CHANGE of the TextInput control
myTextInput_ti.addEventListener(Event.CHANGE, inputInformation);

//The autoSize already set in the Parameter window
//autoSize method allow: right, left, center and none
//myLabel_lb.autoSize = "left";

//Set the font format of the Label
myLabel_lb.setStyle("textFormat", new TextFormat("Arial", 14, 0xFF0000));

 

function inputInformation(evt:Event) {

if (String(textCaseGroup.selectedData) == "Normal") {myLabel_lb.text = evt.target.text;} else if (String(textCaseGroup.selectedData) == "Upper Case") {myLabel_lb.text = evt.target.text.toUpperCase();} else if (String(textCaseGroup.selectedData) == "Lower Case") {myLabel_lb.text = evt.target.text.toLowerCase();}

}

Download Flash Source File:

Flash Source File textinput-and-lable.fla

Remarks:

This Flash ActionScript tutorial shows how to use Flash TextInput component and Label component..

ActionScript Component Control Tutorial