Packagecom.ghostwire.ui.controls
Classpublic class uiComboBox
InheritanceuiComboBox Inheritance uiTextInput Inheritance uiText Inheritance uiComponent Inheritance flash.display.Sprite

The uiComboBox component combines a text input field (uiTextInput) with a drop-down list (uiListBox).

"editable" Property
By default, the text input field is not editable. Set this property to true to allow the end-user to input text directly into the field.

"skin" Property
The default value is "ComboBox" and the asset(s) used are:

 ComboBox.png
 ComboBoxButton.png
 ComboBoxList.png
 ComboBoxListItem.png
 

~ This class is available in Aspire UI Components Lite Edition ~



Public Properties
 PropertyDefined by
 InheritedalignX : Number
Indicates how the component would like to be aligned horizontally within its allocated space.
uiComponent
 InheritedalignY : Number
Indicates how the component would like to be aligned vertically within its allocated space.
uiComponent
 Inheritedbackground : Object
Indicates the style of the background for this component.
uiComponent
 Inheritedcontainer : uiComponent
Indicates the uiComponent instance that contains this instance.
uiComponent
 InheriteddefaultEmbedFonts : Boolean
[static] Deprecated.
uiText
 Inheriteddepth : int
Indicates how deep the component is in the containment hierarchy.
uiComponent
 InheriteddesiredAllocationHeight : int
Indicates the vertical space this component would like to be allocated.
uiComponent
 InheriteddesiredAllocationWidth : int
Indicates the horizontal space this component would like to be allocated.
uiComponent
 InheriteddisplayAsPassword : Boolean
Indicates whether the text should be shown as asterisks instead of the actual characters.
uiTextInput
 Inheritededitable : Boolean
Indicates whether the text can be edited by the user.
uiTextInput
 Inheritedellipsis : String = "..."
[static] Indicates the string to use as an ellipsis if ellipsize is set to true.
uiText
 Inheritedellipsize : Boolean
Always false.
uiTextInput
 InheritedembedFonts : Boolean
Indicates whether this uiText object should use embedded fonts.
uiText
 Inheritedenabled : Boolean
Indicates whether the component is enabled for user interaction.
uiComponent
 InheritedfillX : Boolean
Indicates whether or not the component should automatically expand or shrink to fill its allocated horizontal space.
uiComponent
 InheritedfillY : Boolean
Indicates whether or not the component should automatically expand or shrink to fill its allocated vertical space.
uiComponent
 InheritedfocusPadding : Object
Indicates the thickness of the interior space from the edge of the component to the focus rectangle.
uiComponent
 InheritedfocusRect : Object
Indicates the class to use when rendering the rectangle around the component to indicate that it is in focus.
uiComponent
 Inheritedheight : Number
Indicates the current height of the component.
uiComponent
 Inheritedhint : String
Indicates the text to display in the text field when there is no input value and the instance is not in focus.
uiTextInput
 Inheritedhtml : Boolean
Indicates whether the text is HTML enabled.
uiText
 InheritedimeMode : String
Indicates the mode of the input method editor (IME).
uiTextInput
 Inheritedmargin : Object
Indicates the thickness of the space surrounding the component.
uiComponent
 InheritedmaxHeight : int
Indicates the upper limit for height.
uiComponent
 InheritedmaxWidth : int
Indicates the upper limit for width.
uiComponent
 InheritedminHeight : int
Indicates the lower limit for height.
uiComponent
 InheritedminWidth : int
Indicates the lower limit for width.
uiComponent
 Inheritedpadding : Object
Indicates the thickness of the interior space from the edge of the component to the content area, which is where child components, if any, are contained.
uiComponent
 Inheritedrestrict : String
Indicates the set of characters that a user can enter into the text field.
uiTextInput
  rowCount : int
Indicates the preferred number of rows to display.
uiComboBox
  rowHeight : int
Indicates the fixed value to be used for the height of every row in the list.
uiComboBox
 Inheritedselectable : Boolean
Indicates whether the text is selectable.
uiText
  selectedIndex : int
Indicates the index position of the selected item.
uiComboBox
  selectedItem : Object
Indicates the selected item.
uiComboBox
  selectedValue : Object
[read-only] Indicates the text associated with the selected item, or the input text if editable if true.
uiComboBox
 Inheritedskin : String
Indicates the name of the skin to use for this component instance.
uiComponent
 Inheritedstretch : Boolean
Indicates whether surplus space available in the parent container should be allocated to this component.
uiComponent
 Inheritedtext : String
Indicates the current text displayed by the component.
uiText
 InheritedtextField : TextField
Indicates the native Flash Player TextField object embedded in this uiText instance.
uiText
 InheritedtoolTip : Object
Indicates the content (text) of the tooltip that should be shown when the mouse hovers over this control.
uiComponent
 Inheriteduiskin : uiBitmapImage
Returns the uiBitmapImage rendered as the skin - for advanced users only.
uiComponent
 Inheritedvisible : Boolean
Indicates whether or not the component is visible within its container.
uiComponent
 Inheritedwidth : Number
Indicates the current width of the component.
uiComponent
 Inheritedwrap : Boolean
Indicates whether the text should wrap.
uiText
Public Methods
 MethodDefined by
  
uiComboBox(items:Array = null)
Constructor - creates a new uiComboBox instance.
uiComboBox
  
close():void
Closes the pop-up list, dispatching an Event.CLOSE event.
uiComboBox
 Inherited
invalidate(type:String):void
Invalidates this component's "size", "display", "layout" or "textstyle".
uiComponent
 Inherited
move(x:Number, y:Number, noEvent:Boolean = false):void
Moves the component to the specified position, disregarding its allocation.
uiComponent
  
open():void
Opens the pop-up list, dispatching an Event.OPEN event.
uiComboBox
 Inherited
removeAllChildren(all:Boolean = false):void
Removes all children from this component.
uiComponent
 Inherited
setFocus(flag:Boolean = true):void
Gives this component instance the focus; the component must be on the display list and has its tabEnabled property set to true, otherwise this method will fail silently.
uiComponent
 Inherited
setSize(width:Number, height:Number, noEvent:Boolean = false):void
Sets this component's size to the specified width and height.
uiComponent
 Inherited
setVisible(value:Boolean, noEvent:Boolean = false):void
Sets the visibility of this component instance, dispatching a "show" or "hide" event accordingly.
uiComponent
 Inherited
validateNow():void
Validates and render the component instance, and any component instances with depth higher than itself in the validation queue, immediately.
uiComponent
Events
 EventSummaryDefined by
   Dispatched when the user changes the selection.uiComboBox
 Inherited Dispatched when the text in the component changes.uiTextInput
   Dispatched when the popup list is closed.uiComboBox
 Inherited Dispatched when the component's visible property is changed from true to false via calling the setVisible() method.uiComponent
 Inherited Dispatched when the component's position within its parent container has changed via calling the move() method.uiComponent
   Dispatched when the popup list is opened.uiComboBox
 Inherited Dispatched when the component's size has changed via calling the setSize() method.uiComponent
 Inherited Dispatched when the component's visible property is changed from false to true via calling the setVisible() method.uiComponent
 Inherited Dispatched when the user enters, deletes, or pastes text into the component.uiTextInput
Property detail
rowCountproperty
rowCount:int  [read-write]

Indicates the preferred number of rows to display.

The default value is 8.

Implementation
    public function get rowCount():int
    public function set rowCount(value:int):void
rowHeightproperty 
rowHeight:int  [read-write]

Indicates the fixed value to be used for the height of every row in the list. If set to 0, the height of the first item in the model will be used. If set to -1, it means that variable heights are intended. This can be computationally expensive, so use this with caution if you have a large list.

The default value is 0.

Implementation
    public function get rowHeight():int
    public function set rowHeight(value:int):void
selectedIndexproperty 
selectedIndex:int  [read-write]

Indicates the index position of the selected item.

This property returns -1 if no item has been selected. Note that where editable property is true, if the user selects an item but subsequently edits over the text, the item is deselected.

Setting this property selects the indicated item. To clear all selection, set this property to -1. Setting this property does not dispatch any change event.

The default value is -1.

Implementation
    public function get selectedIndex():int
    public function set selectedIndex(value:int):void

See also

selectedItemproperty 
selectedItem:Object  [read-write]

Indicates the selected item.

This property returns null if no item has been selected.

If editable property is true, if the user selects an item but subsequently edits over the text, the item is deselected, in which case an object with the properties label and data both set to the input text will be returned.

Setting this property selects the indicated item. To clear all selection, set this property to null. Setting this property does not dispatch any change event.

The default value is null.

Implementation
    public function get selectedItem():Object
    public function set selectedItem(value:Object):void

See also

selectedValueproperty 
selectedValue:Object  [read-only]

Indicates the text associated with the selected item, or the input text if editable if true.

The default value is null.

Implementation
    public function get selectedValue():Object
Constructor detail
uiComboBox()constructor
public function uiComboBox(items:Array = null)

Constructor - creates a new uiComboBox instance.

Parameters
items:Array (default = null) — [Optional] An array of objects defining the items in the drop-down list.
Method detail
close()method
public function close():void

Closes the pop-up list, dispatching an Event.CLOSE event. Calling this method has no effect if the pop-up list is not opened or the uiComboBox instance is not yet added to the display list.

open()method 
public function open():void

Opens the pop-up list, dispatching an Event.OPEN event. Calling this method has no effect if the pop-up list is already opened, the uiComboBox is not yet added to the display list, or if the data model is empty.

The pop-up list will be positioned below the uiComboBox instance if there is enough space. Otherwise, it will be positioned above the uiComboBox instance if there is more space above than below.

Event detail
changeevent 
Event object type: flash.events.Event

Dispatched when the user changes the selection. If editable, this event is dispatched each time the user enters a keystroke in the text field.

closeevent  
Event object type: flash.events.Event

Dispatched when the popup list is closed.

openevent  
Event object type: flash.events.TextEvent

Dispatched when the popup list is opened.