Packagecom.gestureworks.cml.elements
Classpublic class DropDownMenu
InheritanceDropDownMenu Inheritance TouchContainer Inheritance com.gestureworks.core.TouchSprite
Subclasses PopupMenu

Drop down menu is used to create a simple menu from a text string of items. The menuItems are a comma separated list of items to populate the menu.
     
        var ddMenu:DropDownMenu = new DropDownMenu();
        ddMenu.x = 500;
        ddMenu.y = 150;
        ddMenu.fill = 0xf2d4c2;
        ddMenu.color = 0xA66874;
        ddMenu.fontSize = 36;
        ddMenu.menuTitle = "Images";
        ddMenu.menuItems = "Image1,Image2,Image3,Image4,Image5";
        addChild(ddMenu);
        ddMenu.init();
                
                    
        // This is the event listener for when a menu item has been selected.
        ddMenu.addEventListener(StateEvent.CHANGE, onItemSelected);
        
        
        function onItemSelected(e:StateEvent):void {
            trace("OnItemSelected", e.value);
        }

     

See also

Menu
OrbMenu


Public Properties
 PropertyDefined By
 InheritedautoShuffle : Boolean
autoshuffles
TouchContainer
 InheritedchildList : ChildList
Returns the object's childList.
TouchContainer
 InheritedclassName : String
sets the class name of displayobject
TouchContainer
 InheritedcloneExclusions : Vector.<String>
[read-only] Returns a list of properties to exclude when cloning this object
TouchContainer
 InheritedcmlIndex : int
Returns the index created by the CML parser.
TouchContainer
  color : uint
The text color
DropDownMenu
 InheriteddimensionsTo : Object
Sets the dimensions of TouchContainer to given object
TouchContainer
 InheriteddropShadow : Boolean
Sets the drop shadow effect
TouchContainer
  fill : uint
Background color for the menu, default grey
DropDownMenu
  font : String
Font style of the menu
DropDownMenu
  fontSize : Number
defines the font size
DropDownMenu
 Inheritedgroup : String
TouchContainer
 Inheritedheight : Number
[override] sets the height of the container
TouchContainer
 InheritedheightPercent : Number
sets the height of the container
TouchContainer
 Inheritedid : String
Returns the object's id.
TouchContainer
 Inheritedlayout : *
specifies the type of layout
TouchContainer
 InheritedlayoutList : Dictionary
TouchContainer
  menuItems : String
The items that will populate the expanding menu panel
DropDownMenu
  menuMarker : Boolean
Sets whether or not to display a triangle to help indicate this is a drop down menu.
DropDownMenu
  menuTitle : String
The menu's title that will always be visible.
DropDownMenu
 InheritedmouseChildren : Boolean
[override] sets the mousechildren value to true or false.
TouchContainer
  open : Boolean
[read-only]
DropDownMenu
 InheritedpaddingBottom : Number
Sets the number of pixels between the container's bottom border and the bottom of its content area.
TouchContainer
 InheritedpaddingLeft : Number
Sets the number of pixels between the component's left border and the left edge of its content area.
TouchContainer
 InheritedpaddingRight : Number
Sets the number of pixels between the component's right border and the right edge of its content area.
TouchContainer
 InheritedpaddingTop : Number
Sets the number of pixels between the container's top border and the top of its content area.
TouchContainer
 Inheritedposition : *
Sets the position
TouchContainer
 InheritedrelativeX : Boolean
When set true this containers children's x position will be laid out relatively to each other.
TouchContainer
 InheritedrelativeY : Boolean
When set true this containers children's y position will be laid out relatively to each other.
TouchContainer
  showPopupBg : Boolean
Shows the popup background
DropDownMenu
  showTitleBg : Boolean
Shows the title background
DropDownMenu
 Inheritedsound : String
TouchContainer
 Inheritedstate : Dictionary
TouchContainer
 InheritedstateId : *
Returns the current state id.
TouchContainer
 InheritedtoBitmap : Boolean
TouchContainer
 Inheritedwidth : Number
[override] sets the width of the container
TouchContainer
 InheritedwidthPercent : Number
sets the width of the container
TouchContainer
Protected Properties
 PropertyDefined By
 InheritedcmlGestureList : Object
TouchContainer
  _color : uint = 0x0000ff
DropDownMenu
  _currentObject : Text
DropDownMenu
  _currentSelection : String
DropDownMenu
  _fill : uint = 0x777777
DropDownMenu
  _font : String = OpenSansRegular
DropDownMenu
  _fontSize : Number = 15
DropDownMenu
  _height : Number
DropDownMenu
  _hit : Sprite
DropDownMenu
  _itemBackgrounds : Array
DropDownMenu
  _menuItems : String = Item1, Item2
DropDownMenu
  _menuItemsArray : Array
DropDownMenu
  menuItemsArray : Array
DropDownMenu
  _menuMarker : Boolean = true
DropDownMenu
  _menuTitle : Text
DropDownMenu
  _open : Boolean = false
DropDownMenu
  _showPopupBg : Boolean = true
DropDownMenu
  _showTitleBg : Boolean = true
DropDownMenu
  _title : String = Menu Title
DropDownMenu
  triangle : Graphic
DropDownMenu
  _width : Number
DropDownMenu
Public Methods
 MethodDefined By
  
dropdown menu Constructor
DropDownMenu
 Inherited
TouchContainer
 Inherited
method searches the child and adds to the list
TouchContainer
 Inherited
addChild(child:DisplayObject):DisplayObject
[override] Adds child to display list and, if not already added, the child list
TouchContainer
 Inherited
addChildAt(child:DisplayObject, index:int):DisplayObject
[override] Adds child to display list and, if not already added, the child list
TouchContainer
 Inherited
applyLayout(value:* = null):void
Apply the containers layout
TouchContainer
 Inherited
childToList(id:String, child:*):void
child appended to the childlist
TouchContainer
 Inherited
clone():*
Clone method
TouchContainer
  
dispose():void
[override] Destructor
DropDownMenu
 Inherited
getElementById(id:String):*
Searches CML childList by id.
TouchContainer
 Inherited
getElementsByClassName(className:String):Array
Searches the CML childList by className.
TouchContainer
 Inherited
getElementsByTagName(tagName:Class):Array
Searches the CML childList by tagName as Class.
TouchContainer
  
hideMenu(noDispatch:Boolean = false):void
DropDownMenu
  
init():void
[override] inialisation method
DropDownMenu
 Inherited
loadState(sId:* = null, recursion:Boolean = false):void
Loads state by index number.
TouchContainer
 Inherited
makeGestureList(value:XMLList):Object
Creates gestureList object from XML
TouchContainer
  
onDownHit(event:* = null):void
DropDownMenu
 Inherited
parseCML(cml:XMLList):XMLList
Parse cml for local layouts.
TouchContainer
 Inherited
postparseCML(cml:XMLList):void
Abstract method allows the setting of a postparse CML routine.
TouchContainer
 Inherited
querySelector(selector:String):*
Searches the CML childList by selector.
TouchContainer
 Inherited
querySelectorAll(selector:*):Array
Search the CML childList by selector.
TouchContainer
 Inherited
removeChild(child:DisplayObject):DisplayObject
[override] Removes child from display list and, if not already removed, the child list
TouchContainer
 Inherited
removeChildAt(index:int):DisplayObject
[override] Removes child from display list and, if not already removed, the child list
TouchContainer
 Inherited
removeChildren(beginIndex:int = 0, endIndex:int = 2147483647):void
[override] Removes children from display list and, if not already removed, the child list
TouchContainer
 Inherited
saveState(sId:* = null, recursion:Boolean = false):void
Save state by index number.
TouchContainer
 Inherited
searchChildren(value:*, returnType:Class = null):*
This method does a depth first search of childLists.
TouchContainer
 Inherited
method sets the dimensions of each child
TouchContainer
  
showMenu(noDispatch:Boolean = false):void
DropDownMenu
 Inherited
tweenState(sId:* = null, tweenTime:Number = 1):void
Tween state by stateIndex from current to given state index.
TouchContainer
 Inherited
Updates child padding within this container
TouchContainer
 Inherited
Updates child percent dimensions within this container
TouchContainer
 Inherited
updateProperties(state:* = 0):void
Updates properties from state.
TouchContainer
 Inherited
Updates child relative positions within this container
TouchContainer
Protected Methods
 MethodDefined By
  
createHit():void
DropDownMenu
  
createMenu():void
DropDownMenu
  
createMenuItem(s:String, idIn:String):Text
DropDownMenu
  
onItemOut(event:*):void
DropDownMenu
  
onItemSelected(event:*):void
DropDownMenu
  
onMenuOut(event:*):void
DropDownMenu
  
onOver(event:*):void
DropDownMenu
Property Detail
_colorproperty
protected var _color:uint = 0x0000ff

_currentObjectproperty 
protected var _currentObject:Text

_currentSelectionproperty 
protected var _currentSelection:String

_fillproperty 
protected var _fill:uint = 0x777777

_fontproperty 
protected var _font:String = OpenSansRegular

_fontSizeproperty 
protected var _fontSize:Number = 15

_heightproperty 
protected var _height:Number

_hitproperty 
protected var _hit:Sprite

_itemBackgroundsproperty 
protected var _itemBackgrounds:Array

_menuItemsproperty 
protected var _menuItems:String = Item1, Item2

_menuItemsArrayproperty 
protected var _menuItemsArray:Array

_menuMarkerproperty 
protected var _menuMarker:Boolean = true

_menuTitleproperty 
protected var _menuTitle:Text

_openproperty 
protected var _open:Boolean = false

_showPopupBgproperty 
protected var _showPopupBg:Boolean = true

_showTitleBgproperty 
protected var _showTitleBg:Boolean = true

_titleproperty 
protected var _title:String = Menu Title

_widthproperty 
protected var _width:Number

colorproperty 
color:uint

The text color

The default value is blue.


Implementation
    public function get color():uint
    public function set color(value:uint):void
fillproperty 
fill:uint

Background color for the menu, default grey

The default value is 0x777777.


Implementation
    public function get fill():uint
    public function set fill(value:uint):void
fontproperty 
font:String

Font style of the menu

The default value is OpenSansRegular.


Implementation
    public function get font():String
    public function set font(value:String):void
fontSizeproperty 
fontSize:Number

defines the font size

The default value is 15;.


Implementation
    public function get fontSize():Number
    public function set fontSize(value:Number):void
menuItemsproperty 
menuItems:String

The items that will populate the expanding menu panel


Implementation
    public function get menuItems():String
    public function set menuItems(value:String):void
menuItemsArrayproperty 
protected var menuItemsArray:Array

menuMarkerproperty 
menuMarker:Boolean

Sets whether or not to display a triangle to help indicate this is a drop down menu.

The default value is true.


Implementation
    public function get menuMarker():Boolean
    public function set menuMarker(value:Boolean):void
menuTitleproperty 
menuTitle:String

The menu's title that will always be visible.


Implementation
    public function get menuTitle():String
    public function set menuTitle(value:String):void
openproperty 
open:Boolean  [read-only]


Implementation
    public function get open():Boolean
showPopupBgproperty 
showPopupBg:Boolean

Shows the popup background

The default value is 0x777777.


Implementation
    public function get showPopupBg():Boolean
    public function set showPopupBg(value:Boolean):void
showTitleBgproperty 
showTitleBg:Boolean

Shows the title background

The default value is 0x777777.


Implementation
    public function get showTitleBg():Boolean
    public function set showTitleBg(value:Boolean):void
triangleproperty 
protected var triangle:Graphic

Constructor Detail
DropDownMenu()Constructor
public function DropDownMenu()

dropdown menu Constructor

Method Detail
createHit()method
protected function createHit():void

createMenu()method 
protected function createMenu():void

createMenuItem()method 
protected function createMenuItem(s:String, idIn:String):Text

Parameters

s:String
 
idIn:String

Returns
Text
dispose()method 
override public function dispose():void

Destructor

hideMenu()method 
public function hideMenu(noDispatch:Boolean = false):void

Parameters

noDispatch:Boolean (default = false)

init()method 
override public function init():void

inialisation method

onDownHit()method 
public function onDownHit(event:* = null):void

Parameters

event:* (default = null)

onItemOut()method 
protected function onItemOut(event:*):void

Parameters

event:*

onItemSelected()method 
protected function onItemSelected(event:*):void

Parameters

event:*

onMenuOut()method 
protected function onMenuOut(event:*):void

Parameters

event:*

onOver()method 
protected function onOver(event:*):void

Parameters

event:*

showMenu()method 
public function showMenu(noDispatch:Boolean = false):void

Parameters

noDispatch:Boolean (default = false)