Flash AS3 Tutorials Center | Interesting Flash Animation Tutorials | Valuing Flash Animation Tutorials | Flash ActionScript and Animation Home

AS3 Beginner Tutorials | AS3 Basic Lessons | AS3 Valuing Courses | AS3 Components Tutorials | AS3 and PHP Interaction Tutorials
AS3 Practical Tutorials | AS3 Animation Techniques | AS3 Transition Effects Tutorials | AS3 Download Upload Files | AS3 Particle Systems
Communication Between Flash Movies with AS3 | AS3 and JavaScript interaction | AS3 Matrix Transformation | AS3 Physics Simulation Tutorials

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.

Please update flash player to view this Flash ActionScript tutorial!

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..