適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: 從伺服器擷取資料...
從伺服器擷取資料...
mx.validators 

IValidator  - AS3 Flex

套件mx.validators
介面public interface IValidator
實作者 GlobalizationValidatorBase, Validator

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 1.5

This interface specifies the methods and properties that a Validator object must implement.

This interface allows to validate multiple data types like numbers, currency, phone numbers, zip codes etc that are defined in both mx and spark namespaces. The classes mx:Validator and spark:GlobaliationValidatorBase implement this interface. The validateAll() method in these classes use this interface type to call the validate() method on multiple validator objects.

相關 API 元素

mx.validators.Validator
spark.validators.GlobalizationValidatorBase


公用屬性
 屬性定義自
  enabled : Boolean
Property to enable/disable validation process.
IValidator
公用方法
 方法定義自
  
validate(value:Object = null, suppressEvents:Boolean = false):ValidationResultEvent
Performs validation and optionally notifies the listeners of the result.
IValidator
屬性詳細資訊

enabled

屬性
enabled:Boolean

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10.1, AIR 2.0

Property to enable/disable validation process.

Setting this value to false will stop the validator from performing validation. When a validator is disabled, it dispatches no events, and the validate() method returns null.

預設值為 true。



實作
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
方法詳細資訊

validate

()方法
public function validate(value:Object = null, suppressEvents:Boolean = false):ValidationResultEvent

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10.1, AIR 2.5

Performs validation and optionally notifies the listeners of the result.

參數

value:Object (default = null) — Optional value to validate. If null, then the validator uses the source and property properties to determine the value. If you specify this argument, you should also set the listener property to specify the target component for any validation error messages.
 
suppressEvents:Boolean (default = false) — If false, then after validation, the validator will notify the listener of the result.

傳回值
ValidationResultEvent — A ValidationResultEvent object containing the results of the validation. For a successful validation, the ValidationResultEvent.results Array property is empty. For a validation failure, the ValidationResultEvent.results Array property contains one ValidationResult object for each field checked by the validator, both for fields that failed the validation and for fields that passed. Examine the ValidationResult.isError property to determine if the field passed or failed the validation.

相關 API 元素





[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。