| Package | com.bit101.components |
| Class | public class ComboBox |
| Inheritance | ComboBox Component flash.display.Sprite |
| Property | Defined By | ||
|---|---|---|---|
|
alternateColor : uint
Sets / gets the color for alternate rows if alternateRows is set to true.
|
ComboBox | ||
|
alternateRows : Boolean
Sets / gets whether or not every other row will be colored with the alternate color.
|
ComboBox | ||
|
defaultColor : uint
Sets/gets the default background color of list items.
|
ComboBox | ||
|
defaultLabel : String
Sets / gets the label that will be shown if no item is selected.
|
ComboBox | ||
![]() |
enabled : Boolean
Sets/gets whether this component is enabled or not.
|
Component | |
![]() |
height : Number [override]
Sets/gets the height of the component.
|
Component | |
|
items : Array
Sets / gets the list of items to be shown.
|
ComboBox | ||
|
listItemClass : Class
Sets / gets the class used to render list items.
|
ComboBox | ||
|
listItemHeight : Number
Sets the height of each list item.
|
ComboBox | ||
|
numVisibleItems : int
Sets / gets the number of visible items in the drop down list.
|
ComboBox | ||
|
openPosition : String
Sets / gets the position the list will open on: top or bottom.
|
ComboBox | ||
|
rolloverColor : uint
Sets/gets the rollover background color of list items.
|
ComboBox | ||
|
selectedColor : uint
Sets/gets the selected background color of list items.
|
ComboBox | ||
|
selectedIndex : int
Sets / gets the index of the selected list item.
|
ComboBox | ||
|
selectedItem : Object
Sets / gets the item in the list, if it exists.
|
ComboBox | ||
![]() |
tag : int
Sets/gets in integer that can identify the component.
|
Component | |
![]() |
width : Number [override]
Sets/gets the width of the component.
|
Component | |
![]() |
x : Number [override] [write-only]
Overrides the setter for x to always place the component on a whole pixel.
|
Component | |
![]() |
y : Number [override] [write-only]
Overrides the setter for y to always place the component on a whole pixel.
|
Component | |
| Property | Defined By | ||
|---|---|---|---|
| _defaultLabel : String | ComboBox | ||
| _dropDownButton : PushButton | ComboBox | ||
![]() |
_enabled : Boolean = true | Component | |
![]() |
_height : Number = 0 | Component | |
| _items : Array | ComboBox | ||
| _labelButton : PushButton | ComboBox | ||
| _list : List | ComboBox | ||
| _numVisibleItems : int = 6 | ComboBox | ||
| _open : Boolean = false | ComboBox | ||
| _openPosition : String = bottom | ComboBox | ||
![]() |
Ronda : Class | Component | |
| _stage : Stage | ComboBox | ||
![]() |
_tag : int = -1 | Component | |
![]() |
_width : Number = 0 | Component | |
| Method | Defined By | ||
|---|---|---|---|
|
ComboBox(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, defaultLabel:String, items:Array = null)
Constructor
|
ComboBox | ||
|
addItem(item:Object):void
Adds an item to the list.
|
ComboBox | ||
|
addItemAt(item:Object, index:int):void
Adds an item to the list at the specified index.
|
ComboBox | ||
|
draw():void
[override]
|
ComboBox | ||
![]() |
initStage(stage:Stage):void
[static]
Utility method to set up usual stage align and scaling.
|
Component | |
![]() |
move(xpos:Number, ypos:Number):void
Moves the component to the specified position.
|
Component | |
|
removeAll():void
Removes all items from the list.
|
ComboBox | ||
|
removeItem(item:Object):void
Removes the referenced item from the list.
|
ComboBox | ||
|
removeItemAt(index:int):void
Removes the item from the list at the specified index
|
ComboBox | ||
![]() |
setSize(w:Number, h:Number):void
Sets the size of the component.
|
Component | |
| Method | Defined By | ||
|---|---|---|---|
|
addChildren():void
[override]
Creates and adds the child display objects of this component.
|
ComboBox | ||
![]() |
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
|
Component | |
|
init():void
[override]
Initilizes the component.
|
ComboBox | ||
![]() |
invalidate():void
Marks the component to be redrawn on the next frame.
|
Component | |
|
onAddedToStage(event:Event):void
Called when the component is added to the stage.
|
ComboBox | ||
|
onDropDown(event:MouseEvent):void
Called when one of the top buttons is pressed.
|
ComboBox | ||
![]() |
onInvalidate(event:Event):void
Called one frame after invalidate is called.
|
Component | |
|
onRemovedFromStage(event:Event):void
Called when the component is removed from the stage.
|
ComboBox | ||
|
onSelect(event:Event):void
Called when an item in the list is selected.
|
ComboBox | ||
|
onStageClick(event:MouseEvent):void
Called when the mouse is clicked somewhere outside of the combo box when the list is open.
|
ComboBox | ||
|
removeList():void
Removes the list from the stage.
|
ComboBox | ||
|
setLabelButtonLabel():void
Determines what to use for the main button label and sets it.
|
ComboBox | ||
| Constant | Defined By | ||
|---|---|---|---|
|
BOTTOM : String = bottom [static]
|
ComboBox | ||
![]() |
DRAW : String = draw [static]
|
Component | |
|
TOP : String = top [static]
|
ComboBox | ||
| _defaultLabel | property |
protected var _defaultLabel:String
| _dropDownButton | property |
protected var _dropDownButton:PushButton
| _items | property |
protected var _items:Array
| _labelButton | property |
protected var _labelButton:PushButton
| _list | property |
protected var _list:List
| _numVisibleItems | property |
protected var _numVisibleItems:int = 6
| _open | property |
protected var _open:Boolean = false
| _openPosition | property |
protected var _openPosition:String = bottom
| _stage | property |
protected var _stage:Stage
| alternateColor | property |
alternateColor:uint
Sets / gets the color for alternate rows if alternateRows is set to true.
public function get alternateColor():uint public function set alternateColor(value:uint):void| alternateRows | property |
alternateRows:Boolean
Sets / gets whether or not every other row will be colored with the alternate color.
public function get alternateRows():Boolean public function set alternateRows(value:Boolean):void| defaultColor | property |
defaultColor:uint
Sets/gets the default background color of list items.
public function get defaultColor():uint public function set defaultColor(value:uint):void| defaultLabel | property |
defaultLabel:String
Sets / gets the label that will be shown if no item is selected.
public function get defaultLabel():String public function set defaultLabel(value:String):void| items | property |
items:Array
Sets / gets the list of items to be shown.
public function get items():Array public function set items(value:Array):void| listItemClass | property |
listItemClass:Class
Sets / gets the class used to render list items. Must extend ListItem.
public function get listItemClass():Class public function set listItemClass(value:Class):void| listItemHeight | property |
listItemHeight:Number
Sets the height of each list item.
public function get listItemHeight():Number public function set listItemHeight(value:Number):void| numVisibleItems | property |
numVisibleItems:int
Sets / gets the number of visible items in the drop down list. i.e. the height of the list.
public function get numVisibleItems():int public function set numVisibleItems(value:int):void| openPosition | property |
openPosition:String
Sets / gets the position the list will open on: top or bottom.
public function get openPosition():String public function set openPosition(value:String):void| rolloverColor | property |
rolloverColor:uint
Sets/gets the rollover background color of list items.
public function get rolloverColor():uint public function set rolloverColor(value:uint):void| selectedColor | property |
selectedColor:uint
Sets/gets the selected background color of list items.
public function get selectedColor():uint public function set selectedColor(value:uint):void| selectedIndex | property |
selectedIndex:int
Sets / gets the index of the selected list item.
public function get selectedIndex():int public function set selectedIndex(value:int):void| selectedItem | property |
selectedItem:Object
Sets / gets the item in the list, if it exists.
public function get selectedItem():Object public function set selectedItem(value:Object):void| ComboBox | () | Constructor |
public function ComboBox(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, defaultLabel:String, items:Array = null)
Constructor
Parameters
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this List.
|
|
xpos:Number (default = 0) — The x position to place this component.
|
|
ypos:Number (default = 0) — The y position to place this component.
|
|
defaultLabel:String — The label to show when no item is selected.
|
|
items:Array (default = null) — An array of items to display in the list. Either strings or objects with label property.
|
| addChildren | () | method |
override protected function addChildren():void
Creates and adds the child display objects of this component.
| addItem | () | method |
public function addItem(item:Object):void
Adds an item to the list.
Parameters
item:Object — The item to add. Can be a string or an object containing a string property named label.
|
| addItemAt | () | method |
public function addItemAt(item:Object, index:int):void
Adds an item to the list at the specified index.
Parameters
item:Object — The item to add. Can be a string or an object containing a string property named label.
|
|
index:int — The index at which to add the item.
|
| draw | () | method |
override public function draw():void
| init | () | method |
override protected function init():void
Initilizes the component.
| onAddedToStage | () | method |
protected function onAddedToStage(event:Event):void
Called when the component is added to the stage.
Parameters
event:Event |
| onDropDown | () | method |
protected function onDropDown(event:MouseEvent):void
Called when one of the top buttons is pressed. Either opens or closes the list.
Parameters
event:MouseEvent |
| onRemovedFromStage | () | method |
protected function onRemovedFromStage(event:Event):void
Called when the component is removed from the stage.
Parameters
event:Event |
| onSelect | () | method |
protected function onSelect(event:Event):void
Called when an item in the list is selected. Displays that item in the label button.
Parameters
event:Event |
| onStageClick | () | method |
protected function onStageClick(event:MouseEvent):void
Called when the mouse is clicked somewhere outside of the combo box when the list is open. Closes the list.
Parameters
event:MouseEvent |
| removeAll | () | method |
public function removeAll():void
Removes all items from the list.
| removeItem | () | method |
public function removeItem(item:Object):void
Removes the referenced item from the list.
Parameters
item:Object — The item to remove. If a string, must match the item containing that string. If an object, must be a reference to the exact same object.
|
| removeItemAt | () | method |
public function removeItemAt(index:int):void
Removes the item from the list at the specified index
Parameters
index:int — The index of the item to remove.
|
| removeList | () | method |
protected function removeList():void
Removes the list from the stage.
| setLabelButtonLabel | () | method |
protected function setLabelButtonLabel():void
Determines what to use for the main button label and sets it.
| BOTTOM | Constant |
public static const BOTTOM:String = bottom
| TOP | Constant |
public static const TOP:String = top