User Guide

376 Chapter 6: Components Dictionary
Example
This example, written on a frame of the Timeline, sends a message to the Output panel when a
date field called
myDF is changed. The first line of code creates a listener object called form. The
second line defines a function for the
change event on the listener object. Inside the function is a
trace() statement that uses the event object that is automatically passed to the function, in this
example
eventObj, to generate a message. The target property of an event object is the
component that generated the event—in this example,
myDF. The DateField.selectedDate
property is accessed from the event object’s
target property. The last line calls
EventDispatcher.addEventListener() from myDF and passes it the change event and the
form listener object as parameters.
function change(eventObj){
trace("date selected " + eventObj.target.selectedDate) ;
}
myDF.addEventListener("change", this);
DateField.close()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myDF.close()
Parameters
None.
Returns
Nothing.
Description
Method; closes the pop-up menu.
Example
The following code closes the date chooser pop-up of the myDF date field instance:
myDF.close();
DateField.close
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.