MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 1227

Components language reference
Table of Contents

Advertisement

For more information, see
Example
This example creates a listener for an enter event on a TextInput instance called
the enter event occurs, if the user entered fewer than eight characters, the example displays:
You must enter at least 8 characters
You must first drag a TextInput component to the Stage and give it an instance name of
; then add the following code to Frame 1.
my_ti
/**
Requires:
- TextInput instance on Stage (instance name: my_ti)
*/
var my_ti:mx.controls.TextInput;
// Create listener object.
var tiListener:Object = new Object();
tiListener.handleEvent = function (evt_obj:Object){
if (evt_obj.type == "enter"){
if (my_ti.length < 8) {
trace("You must enter at least 8 characters");
} else {
trace("Thanks");
}
}
}
// Add listener.
my_ti.addEventListener("enter", tiListener);
See also
EventDispatcher.addEventListener()
"EventDispatcher class" on page
. Otherwise, it displays
499.
my_ti
Thanks!
TextInput.enter
. When
1223

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents