Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > Data binding classes > CustomValidator class | |||
ActionScript Class Name mx.data.binding.CustomValidator
You use the CustomValidator class when you want to perform custom validation of a data field contained by a component. To make this class available at runtime, you must include the data binding classes in your FLA file. For more information, see Making data binding classes available at runtime.
|
NOTE |
|
The CustomValidator class is supported only if you are working in a document that specifies ActionScript 2.0 in its Publish Settings. |
To create a custom validator class, you first create a subclass of mx.data.binding.CustomValidator that implements a method named validate(). This method is automatically passed a value to be validated. For more information about how to implement this method, see CustomValidator.validate().
Next, you assign your custom validator class to a field of a component by using the Component inspector's Schema tab. For an example of creating and using a custom validator class, see the Example section in the CustomValidator.validate() entry.
In order for the class you specify to be included in the published SWF file, it must be in the classpath.
For an overview of the classes in the mx.data.binding package, see Classes in the mx.data.binding package.
The following table lists the methods of the CustomValidator class.
|
Method |
Description |
|---|---|
|
Performs validation on data. |
|
|
Reports validation errors. |
Flash CS3