Datefield Component (Flash Professional Only) - MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Creating an application with the DateField component
The following procedure explains how to add a DateField component to an application while
authoring. In this example, the DateField component allows a user to pick a date for an airline
reservation system. All dates before today's date must be disabled. Also, a 15-day range in
December must be disabled to create a holiday black-out period. Also, some flights are not
available on Mondays, so all Mondays must be disabled for those flights.
To create an application with the DateField component:
Double-click the DateField component in the Components panel to add it to the Stage.
1.
In the Property inspector, enter the instance name flightCalendar.
2.
In the Actions panel, enter the following code on Frame 1 of the Timeline to set the range of
3.
selectable dates:
flightCalendar.selectableRange = {rangeStart:new Date(2001, 9, 1),
rangeEnd:new Date(2003, 11, 1)};
This code assigns a value to the
contains two Date objects with the variable names
upper and lower end of a range within which the user can select a date.
In the Actions panel, enter the following code on Frame 1 of the Timeline to set the ranges of
4.
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)}];
In the Actions panel, enter the following code on Frame 1 of the Timeline to disable Mondays:
5.
flightCalendar.disabledDays=[1];
Control > Test Movie.
6.
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
UIObject.setSize()
the DateField component. However, you can use the
DateChooser component and set its dimensions.
Using styles with the DateField component
You can set style properties to change the appearance of a date field instance. If the name of a style
property ends in "Color", it is a color style property and behaves differently than noncolor style
properties. For more information, see
on page
67.
368
Chapter 6: Components Dictionary
selectableRange
). Setting the width does not change the dimensions of the date chooser in
"Using styles to customize component color and text"
property in an ActionScript object that
and
rangeStart
rangeEnd
method (see
setSize()
property to access the
pullDown
. This defines an

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents