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

Popup 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 ppMenu:PopupMenu = new PopupMenu();
        ppMenu.x = 500;
        ppMenu.y = 150;
        ppMenu.fill = 0xf2d4c2;
        ppMenu.color = 0xA66874;
        ppMenu.fontSize = 36;
        ppMenu.menuTitle = "Images";
        ppMenu.menuItems = "Image1,Image2,Image3,Image4,Image5";
        addChild(ppMenu);
        ppMenu.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

DropDownMenu
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
 Inheritedcolor : uint
The text color
DropDownMenu
 InheriteddimensionsTo : Object
Sets the dimensions of TouchContainer to given object
TouchContainer
 InheriteddropShadow : Boolean
Sets the drop shadow effect
TouchContainer
 Inheritedfill : uint
Background color for the menu, default grey
DropDownMenu
 Inheritedfont : String
Font style of the menu
DropDownMenu
 InheritedfontSize : 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
 InheritedmenuItems : String
The items that will populate the expanding menu panel
DropDownMenu
 InheritedmenuMarker : Boolean
Sets whether or not to display a triangle to help indicate this is a drop down menu.
DropDownMenu
 InheritedmenuTitle : String
The menu's title that will always be visible.
DropDownMenu
 InheritedmouseChildren : Boolean
[override] sets the mousechildren value to true or false.
TouchContainer
 Inheritedopen : 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
 InheritedshowPopupBg : Boolean
Shows the popup background
DropDownMenu
 InheritedshowTitleBg : 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
 Inherited_color : uint = 0x0000ff
DropDownMenu
 Inherited_currentObject : Text
DropDownMenu
 Inherited_currentSelection : String
DropDownMenu
 Inherited_fill : uint = 0x777777
DropDownMenu
 Inherited_font : String = OpenSansRegular
DropDownMenu
 Inherited_fontSize : Number = 15
DropDownMenu
 Inherited_height : Number
DropDownMenu
 Inherited_hit : Sprite
DropDownMenu
 Inherited_itemBackgrounds : Array
DropDownMenu
 Inherited_menuItems : String = Item1, Item2
DropDownMenu
 Inherited_menuItemsArray : Array
DropDownMenu
 InheritedmenuItemsArray : Array
DropDownMenu
 Inherited_menuMarker : Boolean = true
DropDownMenu
 Inherited_menuTitle : Text
DropDownMenu
 Inherited_open : Boolean = false
DropDownMenu
 Inherited_showPopupBg : Boolean = true
DropDownMenu
 Inherited_showTitleBg : Boolean = true
DropDownMenu
 Inherited_title : String = Menu Title
DropDownMenu
 Inheritedtriangle : Graphic
DropDownMenu
 Inherited_width : Number
DropDownMenu
Public Methods
 MethodDefined By
  
Constructor
PopupMenu
 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
 Inherited
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
 Inherited
hideMenu(noDispatch:Boolean = false):void
DropDownMenu
  
init():void
[override] inialization method
PopupMenu
 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
[override]
PopupMenu
 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
 Inherited
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
 Inherited
createHit():void
DropDownMenu
 Inherited
createMenu():void
DropDownMenu
 Inherited
createMenuItem(s:String, idIn:String):Text
DropDownMenu
 Inherited
onItemOut(event:*):void
DropDownMenu
  
onItemSelected(event:*):void
[override]
PopupMenu
 Inherited
onMenuOut(event:*):void
DropDownMenu
 Inherited
onOver(event:*):void
DropDownMenu
Constructor Detail
PopupMenu()Constructor
public function PopupMenu()

Constructor

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

inialization method

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

Parameters

event:* (default = null)

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

Parameters

event:*