Thursday, April 22, 2010

control the number of characters a user can type into a Flash ActionScript 3.0 TextInput control

The following example shows how you can control the number of characters a user can type into a Flash ActionScript 3.0 TextInput control by setting the maxChars property.

Full code after the jump.

// ActionScript 3.0
/* Requires:
* - TextInput component in Flash library
*/
import fl.controls.TextInput;

var textInput:TextInput = new TextInput();
textInput.maxChars = 5;
textInput.move(10, 10);
addChild(textInput);

No comments:

Post a Comment