User Guide
Customizing the DateField component (Flash Professional only) 435
This code assigns a value to the selectableRange property in an ActionScript object that
contains two Date objects with the variable names
rangeStart and rangeEnd. This
defines an upper and lower end of a range within which the user can select a date.
4. In the Actions panel, enter the following code on Frame 1 of the timeline to set the ranges
of disabled dates, one during December, and one for all dates before the current date:
flightCalendar.disabledRanges = [{rangeStart: new Date(2003, 11, 15),
rangeEnd: new Date(2003, 11, 31)}, {rangeEnd: new Date(2003, 6, 16)}];
5.
In the Actions panel, enter the following code on Frame 1 of the timeline to
disable Mondays:
flightCalendar.disabledDays=[1];
6.
Control > Test Movie.
To create a DateField component instance using ActionScript:
1. Drag the DateField component from the Components panel to the current
document’s library.
This adds the component to the library, but doesn’t make it visible in the application.
2. Select the first frame in the main Timeline, open the Actions panel, and enter the
following code:
this.createClassObject(mx.controls.DateField, "my_df", 1);
This script uses the method UIObject.createClassObject() to create the
DateField instance.
3. Select Control > Test Movie.
Customizing the DateField component
(Flash Professional only)
You can transform a DateField component horizontally while authoring and at runtime.
While authoring, select the component on the Stage and use the Free Transform tool or any
of the Modify > Transform commands. At runtime, use the
setSize() method (see
UIObject.setSize()). Setting the width does not change the dimensions of the date chooser
in the DateField component. However, you can use the
pullDown property to access the
DateChooser component and set its dimensions.