MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 221

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

Advertisement

Method summary for the CustomValidator class
The following table lists the methods of the CustomValidator class.
Method
CustomValidator.validate()
CustomValidator.validationError()
CustomValidator.validate()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
This method is called automatically; you don't invoke it directly.
Parameters
The data to be validated; it can be of any type.
value
Returns
Nothing.
Description
Method; called automatically to validate the data contained by the
implement this method in your subclass of CustomValidator; the default implementation
does nothing.
You can use any ActionScript code to examine and validate the data. If the data is not valid, this
method should call
this.validationError()
Since
validate()
complete. Your implementation of this method should only check for validity, and then report
any errors using
not take any action as a result of the validation test, such as alerting the end user. Instead, create
event listeners for
the example below).
Example
The following procedure demonstrates how to create and use a custom validator class. The
method of the CustomValidator class OddNumbersOnly.as determines any value
validate()
that is not an odd number to be invalid. The validation occurs whenever a change occurs in the
value of a NumericStepper component, which is bound to the
Label component.
Description
Performs validation on data.
Reports validation errors.
this.validationError()
more than once if there are several validation problems with the data.
might be called repeatedly, avoid adding code that takes a long time to
CustomValidator.validationError()
and
valid
invalid
with an appropriate message. You can call
. Similarly, your implementation should
events and alert the end user from those event listeners (see
Data binding classes (Flash Professional only)
parameter. You must
value
property of a
text
221

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