A text input component for ZIP Codes in the USA, which are postal codes that designate different regions within the country. A ZIP Code is divided into two parts; the first part consists of five digits that are always required, while an optional second part adds four more digits to designate a more specific location. A ZIP Code with both parts is known as ZIP+4. Example ZIP Codes include 55082, 90210, and 20500-0005.

Events:

openfl.events.Event.CHANGE

Dispatched when ZIPCodeTextInput.text changes.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

Static variables

@:value("zipCodeTextInput_errorCallout")staticfinalread onlyCHILD_VARIANT_ERROR_CALLOUT:String = "zipCodeTextInput_errorCallout"

The variant used to style the error string TextCallout child component in a theme.

To override this default variant, set the ZIPCodeTextInput.customErrorCalloutVariant property.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

Constructor

@:value({ text : "" })new(text:String = "", ?changeListener:Event ‑> Void)

Creates a new ZIPCodeTextInput object.

Available since

feathersui-text-inputs-pack 1.0.0

.

Variables

@:style@:flash.propertybackgroundSkin:DisplayObject

The default background skin for the text input, which is used when no other skin is defined for the current state with setSkinForState().

The following example passes a bitmap for the text input to use as a background skin:

input.backgroundSkin = new Bitmap(bitmapData);
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

read onlybaseline:Float

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

  • feathers.controls.ITextControl.baseline

@:bindable("stateChange")read onlycurrentState:TextInputState

The current state of the text input.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

  • feathers.controls.TextInputState

  • FeathersEvent.STATE_CHANGE

@:style@:flash.propertycustomErrorCalloutVariant:String

A custom variant to set on the error callout, instead of ZIPCodeTextInput.CHILD_VARIANT_ERROR_CALLOUT.

The customErrorCalloutVariant will be not be used if the TextCallout already has a variant set.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertydisabledTextFormat:AbstractTextFormat

The font styles used to render the text input's text when the text input is disabled.

In the following example, the text input's disabled text formatting is customized:

input.enabled = false;
input.disabledTextFormat = new TextFormat("Helvetica", 20, 0xee0000);
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

editable:Bool

Indicates if the text input is editable.

The following example disables editing:

textInput.editable = false;
Available since

feathersui-text-inputs-pack 1.0.0

.

@:style@:flash.propertyembedFonts:Bool

Determines if an embedded font is used or not.

In the following example, the text input uses embedded fonts:

input.embedFonts = true;
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

errorCalloutFactory:AbstractDisplayObjectFactory<Dynamic, TextCallout>

Creates the error callout, which must be of type feathers.controls.TextCallout.

In the following example, a custom error callout factory is provided:

textInput.errorCalloutFactory = () ->
{
	return new TextCallout();
};
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

  • feathers.controls.TextCallout

errorString:String

Error text to display in a TextCallout when the text input has focus. When this value is not null the text input's currentState is changed to TextInputState.ERROR.

An empty string will change the background, but no TextCallout will appear on focus.

To clear an error, the errorString property must be set to null.

The following example displays an error string:

input.errorString = "Something is wrong";
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

read onlyerrorStringCalloutOpen:Bool

Indicates if the callout for the errorString is currently open or closed.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertyleftView:DisplayObject

An optional view displayed inside the text input, to the left of its text.

The following example passes a bitmap for the text input to use as a left view:

input.leftView = new Bitmap(bitmapData);
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertyleftViewGap:Float

The gap between the left view and the text.

The following example sets the left view's gap to 20 pixels:

input.leftViewGap = 20.0;
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertyoptionalDelimiterAlpha:Float

The alpha value of the delimiter text field when it is displayed in an optional state.

Available since

feathersui-text-inputs-pack 1.0.0

.

@:style@:flash.propertypaddingBottom:Float

The minimum space, in pixels, between the text input's bottom edge and the text input's content.

In the following example, the text input's bottom padding is set to 20 pixels:

input.paddingBottom = 20.0;
Available since

feathersui-text-inputs-pack 1.0.0

.

@:style@:flash.propertypaddingLeft:Float

The minimum space, in pixels, between the text input's left edge and the text input's content.

In the following example, the text input's left padding is set to 20 pixels:

input.paddingLeft = 20.0;
Available since

feathersui-text-inputs-pack 1.0.0

.

@:style@:flash.propertypaddingRight:Float

The minimum space, in pixels, between the text input's right edge and the text input's content.

In the following example, the text input's right padding is set to 20 pixels:

input.paddingRight = 20.0;
Available since

feathersui-text-inputs-pack 1.0.0

.

@:style@:flash.propertypaddingTop:Float

The minimum space, in pixels, between the text input's top edge and the text input's content.

In the following example, the text input's top padding is set to 20 pixels:

input.paddingTop = 20.0;
Available since

feathersui-text-inputs-pack 1.0.0

.

plus4Mode:ZIPCodePlus4Mode

Determines how to handle the final four digits of ZIP+4.

The following example requires the final four digits:

textInput.plus4Mode = REQUIRED;
Available since

feathersui-text-inputs-pack 1.0.0

.

@:style@:flash.propertyrightView:DisplayObject

An optional view displayed inside the text input, to the right of its text.

The following example passes a bitmap for the text input to use as a right view:

input.rightView = new Bitmap(bitmapData);
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertyrightViewGap:Float

The gap between the right view and the text.

The following example sets the right view's gap to 20 pixels:

input.rightViewGap = 20.0;
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:bindable("change")text:String

The ZIP code string displayed by the text input. Returns a formatted ZIP code with a - character between the two parts. If the current ZIP code does not include a +4 part, and plus4Mode is not set to ZipCodePlus4Mode.REQUIRED, the - will be omitted.

The setter accepts either a string of 5 numeric digits, or a full ZIP+4 value with the - delimiter between the two parts, or all nine digits only with no delimiter. Partial ZIP and ZIP+4 values are allowed as well.

When the value of the text property changes, the text input will dispatch an event of type Event.CHANGE.

The following example sets the text input's text with a five digit ZIP Code value:

input.text = "12345";

The following example sets the text input's text with a ZIP+4 value:

input.text = "12345-6789";

The following example sets the text input's text to a partial ZIP-4 value:

input.text = "12345-6";
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertytextFormat:AbstractTextFormat

The font styles used to render the text input's text.

In the following example, the text input's formatting is customized:

input.textFormat = new TextFormat("Helvetica", 20, 0xcc0000);
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertyverticalAlign:VerticalAlign

How the content is positioned vertically (along the y-axis) within the text input.

The following example aligns the text input's content to the top:

input.verticalAlign = TOP;
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

  • feathers.layout.VerticalAlign.TOP

  • feathers.layout.VerticalAlign.MIDDLE

  • feathers.layout.VerticalAlign.BOTTOM

  • feathers.layout.VerticalAlign.JUSTIFY

Methods

getSkinForState(state:TextInputState):DisplayObject

Gets the skin to be used by the text input when its currentState property matches the specified state value.

If a skin is not defined for a specific state, returns null.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

getTextFormatForState(state:TextInputState):AbstractTextFormat

Gets the text format to be used by the text input when its currentState property matches the specified state value.

If a text format is not defined for a specific state, returns null.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

setPadding(value:Float):Void

Sets all four padding properties to the same value.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@stylesetSkinForState(state:TextInputState, skin:DisplayObject):Void

Set the skin to be used by the text input when its currentState property matches the specified state value.

If a skin is not defined for a specific state, the value of the backgroundSkin property will be used instead.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@stylesetTextFormatForState(state:TextInputState, textFormat:AbstractTextFormat):Void

Set the text format to be used by the text input when its currentState property matches the specified state value.

If a text format is not defined for a specific state, the value of the textFormat property will be used instead.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also: