MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 233

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

Advertisement

Returns
An array, or
.
null
Description
Method; determines if the data in
The property's schema settings are those specified on the Schema tab in the Component
Inspector panel.
The method returns
as strings.
Validation applies only to fields that have schema information available. If a field is an object that
contains other fields, each "child" field is validated, and so on, recursively. Each individual field
dispatches a
valid
, this method dispatches
propertyName
If the value of the field is
are generated.
If the value the field is
is generated.
If the value of the field is not
returns
; no events are generated.
null
If the value is not
the validator object. If the data is valid, a
otherwise, an
invalid
Example
The following example shows how to use
a user is of a valid length. You'll determine the valid length by setting the Validation Options for
the String data type in the Component inspector's Schema tab. If the user enters a string of
invalid length in the text field, the error messages returned by
in the Output panel.
To validate text entered by a user in a TextInput component:
Drag a TextInput component from the Components panel to the Stage, and name it
1.
zipCode_txt.
Select the TextInput component and, in the Component inspector, click the Schema tab.
2.
In the Schema Tree pane (the top pane of the Schema tab), select the
3.
In the Schema Attributes pane (the bottom pane of the Schema tab), select ZipCode from the
4.
Data Type pop-up menu.
Open the Timeline if it is not already open.
5.
Click the first frame on Layer 1 in the Timeline, and open the Actions panel (Window >
6.
Development Panels > Actions).
propertyName
if the data is valid; otherwise, it returns an array of error messages
null
or
event, as necessary. For each data field contained by
invalid
valid
, and is not required, the method returns
null
, and is required, an error is returned and an
null
and the field's schema does not have a validator, the method
null
and the field's schema does define a validator, the data is processed by
null
event is generated and an array of error strings is returned.
validateProperty()
is valid based on the property's schema settings.
or
events, as follows:
invalid
event is generated and
valid
to make sure that text entered by
validateProperty()
Data binding classes (Flash Professional only)
. No events
null
event
invalid
is returned;
null
are displayed
property.
text
233

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx

Table of Contents