Packagemx.formatters
Classpublic class ZipCodeFormatter
InheritanceZipCodeFormatter Inheritance Formatter Inheritance Object

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

The ZipCodeFormatter class formats a valid number into one of the following formats, based on a user-supplied formatString property.

A six-digit number must be supplied for a six-digit mask. If you use a five-digit or a nine-digit mask, you can use either a five-digit or a nine-digit number for formatting.

If an error occurs, an empty String is returned and a String that describes the error is saved to the error property. The error property can have one of the following values:

MXML SyntaxexpandedHide MXML Syntax

The <mx:ZipCodeFormatter> tag inherits all of the tag attributes of its superclass, and adds the following tag attributes:

  <mx:ZipCodeFormatter
    formatString="#####|#####-####|### ###"
  />
  

See also

mx.formatters.SwitchSymbolFormatter


Public Properties
 PropertyDefined By
 InheriteddefaultInvalidFormatError : String
[static] Error message for an invalid format string specified to the formatter.
Formatter
 InheriteddefaultInvalidValueError : String
[static] Error messages for an invalid value specified to the formatter.
Formatter
 Inheritederror : String
Description saved by the formatter when an error occurs.
Formatter
  formatString : String
The mask pattern.
ZipCodeFormatter
Protected Properties
 PropertyDefined By
 InheritedresourceManager : IResourceManager
[read-only] A reference to the object which manages all of the application's localized resources.
Formatter
Public Methods
 MethodDefined By
  
Constructor.
ZipCodeFormatter
  
format(value:Object):String
[override] Formats the String by using the specified format.
ZipCodeFormatter
Protected Methods
 MethodDefined By
 Inherited
This method is called when a Formatter is constructed, and again whenever the ResourceManager dispatches a "change" Event to indicate that the localized resources have changed in some way.
Formatter
Property Detail
formatStringproperty
formatString:String

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

The mask pattern. Possible values are "#####-####", "##### ####", "#####", "###-###" and "### ###".

The default value is "#####".


Implementation
    public function get formatString():String
    public function set formatString(value:String):void
Constructor Detail
ZipCodeFormatter()Constructor
public function ZipCodeFormatter()

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

Constructor.

Method Detail
format()method
override public function format(value:Object):String

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

Formats the String by using the specified format. If the value cannot be formatted, return an empty String and write a description of the error to the error property.

Parameters

value:Object — Value to format.

Returns
String — Formatted String. Empty if an error occurs. A description of the error condition is written to the error property.