Package | com.gestureworks.cml.element |
Class | public class OrbMenu |
Inheritance | OrbMenu ![]() ![]() ![]() ![]() ![]() |
var orb:OrbMenu = new OrbMenu(); // listen to orb menu's state event for button presses addEventListener(StateEvent.CHANGE, changeBkg); bkg = new Graphic(); bkg.shape = "rectangle"; bkg.width = stage.width; bkg.height = stage.height; bkg.color = 0x000000; addChild(bkg); //can set the timer and attract mode of orbmenu orb.repeatTimer = 1; orb.attractMode = true; //curve text location of orbmenu orb.textX = 90; orb.textY = 80; orb.textRadius = 100; orb.curveText = "MENU"; orb.coverage = 0.4; orb.startAngle = 100; orb.stopAngle = 100; //circle radius orb.orbRadius = 100; //gradient matrix graphics orb.gradientType = "linear"; orb.gradientColors = "0x404040, 0x404040"; orb.gradientAlphas = "1,1"; orb.gradientRatios = "0,255"; orb.gradientHeight = 100; orb.gradientWidth = 50; orb.gradientRotation = 0; orb.gradientX = 25; orb.gradientY = 0; //outer circle graphics orb.shape1LineStoke = 3; orb.shape1OutlineColor = 0x000000; //inner circle graphics orb.shape2LineStoke = 3; orb.shape2OutlineColor = 0x000000; //background(rectangle) graphics orb.backgroundColor = 0x808080; orb.backgroundOutlineColor = 0x000000; orb.backgroundLineStoke = 3; //background(rectangle) graphics background = new Graphic(); background.visible = false; orb.addChild(background); var numberOfButtons:int = 3; var width:Number = 100; var height:Number = 135; var orbRadius:Number = 100; buttons = new Array(numberOfButtons); // position of buttons,lines,background { var line:Sprite = new Sprite(); line.graphics.lineStyle(0, 0x000000, 1); line.graphics.moveTo((width i + orbRadius), 0); line.graphics.lineTo((width i + orbRadius), height); buttons[i] = new Button(); if (i==0) buttons[i] = createButton(buttons[i], "btn0", "grey"); else if (i == 1) buttons[i] = createButton(buttons[i], "btn1","purple"); else if (i == 2) buttons[i] = createButton(buttons[i], "btn2", "pink"); buttons[i].x = 100 + width i; buttons[i].y = 0; background.addChild(buttons[i]); buttons[i].init(); background.addChild(line); } if (numberOfButtons > 1) { background.graphics.beginFill(0x808080); background.graphics.drawRoundRect(0- width , 0, (orbRadius + width) + (width numberOfButtons), 135, 25, 25); } else { background.graphics.drawRoundRect(0, 0, (orbRadius + width), 135, 25, 25); } orb.buttons = buttons; orb.init(); addChild(orb); function createButton(b:Button, type:String, value:String):Button { var btnUp:Container = new Container(); btnUp.id = type + "-up"; var text:Text = new Text(); text.text = value; text.x = 17; text.y = 45; text.selectable = false; text.color = 0x151B54; text.fontSize = 20; text.visible = true; text.multiline = true; text.font = "OpenSansRegular"; btnUp.addChild(text); var btnDown:Container = new Container(); btnDown.id = "btn-down"; var btnHit:Container = new Container(); btnHit.id = type + "-hit"; var hitBg:Graphic = new Graphic(); hitBg.shape = "rectangle"; hitBg.id = type + "HitBg"; hitBg.alpha = 0; hitBg.width = 100; hitBg.height = 100; hitBg.lineStroke = 1.5; hitBg.color = 0xCCCCCC; btnHit.addChild(hitBg); btnHit.childToList(type + "HitBg", hitBg); b.addChild(btnUp); b.childToList(type + "-up", btnUp); b.addChild(btnDown); b.childToList(type + "-down", btnDown); b.addChild(btnHit); b.childToList(type + "-hit", btnHit); b.initial = type + "-up"; b.up = type + "-up"; b.out = type + "-up"; b.down = type + "-down"; b.hit = type + "-hit"; b.dispatch = "down:" + type; return b; } //background color changes on state event. function changeBkg(event:StateEvent):void { if (event.value == "btn0") { bkg.visible = true; bkg.color = 0x817679; } else if (event.value == "btn1") { bkg.visible = true; bkg.color = 0x5E5A80; } else if (event.value == "btn2") { bkg.visible = true; bkg.color = 0xC48189; } }
Property | Defined By | ||
---|---|---|---|
![]() | alpha : Number [override] [write-only]
sets the alpha for display objects
| ElementFactory | |
attractMode : Boolean
defines whether Orbmenu is floating or not
| OrbMenu | ||
![]() | autoHide : Boolean
Specifies whether the menu automatically hides when not in use
| Menu | |
![]() | autoHideTime : Number
Specifies the auto-hide time
| Menu | |
background : Sprite
Defines background in rectangle shape of orbMenu. | OrbMenu | ||
backgroundColor : uint
Sets the background color
| OrbMenu | ||
backgroundLineStoke : uint
Sets the background line stoke
| OrbMenu | ||
backgroundOutlineColor : uint
Sets the background out line color
| OrbMenu | ||
![]() | blur : Boolean
Sets the drop shadow effect
| ElementFactory | |
![]() | bottom : Number
sets the bottom value
| ElementFactory | |
![]() | buttonArray : Array | Menu | |
buttons : Array
Defines array of buttons. | OrbMenu | ||
![]() | childList : ChildList [read-only]
store the child list
| ContainerFactory | |
![]() | class_ : String
Object's css class;
| ElementFactory | |
![]() | className : String
sets the class name of displayobject
| ElementFactory | |
![]() | cmlIndex : int
sets the cml index
| ElementFactory | |
coverage : Number
defines the coverage of text
| OrbMenu | ||
curveText : String
defines the text
| OrbMenu | ||
![]() | debugStyle : *
sets the debug style
| ElementFactory | |
![]() | dimensionsTo : String
sets the dimensions of the container
| ContainerFactory | |
![]() | displayEvents : String
Use for dispatch completes. | ElementFactory | |
dropshadow : DropShadowFilter
Defines dropshadow filter for shape. | OrbMenu | ||
![]() | dropShadow : Boolean
Sets the drop shadow effect
| ElementFactory | |
filtersArray : Array
Defines array for drop shadow filter. | OrbMenu | ||
gradientAlphas : String
Sets the alpha transparency of gradient for shapes
| OrbMenu | ||
gradientColors : String
Sets the array of color values of gradient for shapes
| OrbMenu | ||
gradientHeight : Number
the width (in pixels) to which the gradient will spread
| OrbMenu | ||
gradientRatios : String
Sets the ratios of gradient for shapes
| OrbMenu | ||
gradientRotation : Number
the rotation (in radians) that will be applied to the gradient
| OrbMenu | ||
gradientType : String
Sets the gardient type for shapes
| OrbMenu | ||
gradientWidth : Number
the width (in pixels) to which the gradient will spread
| OrbMenu | ||
gradientX : Number
how far (in pixels) the gradient is shifted horizontally
| OrbMenu | ||
gradientY : Number
how far (in pixels) the gradient is shifted horizontally
| OrbMenu | ||
![]() | height : Number [override]
Sets width of the display object in pixels
| ElementFactory | |
![]() | heightPercent : String
sets the height percent of display object
| ElementFactory | |
![]() | horizontalCenter : Number
sets the horizontal center of display object
| ElementFactory | |
![]() | id : String
sets the id of child
| ElementFactory | |
![]() | index : int
sets the index of display object
| ElementFactory | |
![]() | infoSource : String
sets info source
| ContainerFactory | |
![]() | layout : *
Sets the layout of the container
| Container | |
![]() | layoutComplete : Function
Sets the function to call when the layout is complete
| Container | |
![]() | layoutList : Dictionary
Defines the layoutlist
| Container | |
![]() | layoutUpdate : Function
Sets the function to call when the layout updates
| Container | |
![]() | left : Number
sets left value
| ElementFactory | |
line : Sprite
Defines intersection lines of background. | OrbMenu | ||
matrix : Matrix
Defines to control gradient appearance of shapes. | OrbMenu | ||
orbRadius : Number
Defines radius of orbmenu. | OrbMenu | ||
![]() | paddingBottom : Number
Sets the number of pixels between the container's bottom border and the bottom of its content area. | Container | |
![]() | paddingLeft : Number
Sets the number of pixels between the component's left border and the left edge of its content area. | Container | |
![]() | paddingRight : Number
Sets the number of pixels between the component's right border and the right edge of its content area. | Container | |
![]() | paddingTop : Number
Sets the number of pixels between the container's top border and the top of its content area. | Container | |
![]() | position : String [override]
Specifies the position alogorithm of the menu. | Menu | |
![]() | propertyStates : Array Deprecated: Please Use state | ElementFactory | |
repeatTimer : Number
number of times the timer will tick before the timer stops itself
| OrbMenu | ||
![]() | right : Number
sets the right value
| ElementFactory | |
![]() | scale : Number
Sets both the x and y scale values
| ElementFactory | |
![]() | scaleX : Number [override]
Sets width of the display object in pixels
| ElementFactory | |
![]() | scaleY : Number [override]
Sets width of the display object in pixels
| ElementFactory | |
shape1 : Sprite
Defines the OuterCircle which is a rectangle
| OrbMenu | ||
shape1LineStoke : Number
Defines linestoke of shape1. | OrbMenu | ||
shape1OutlineColor : uint
Sets the outline color of shape1
| OrbMenu | ||
shape2 : Sprite
Defines the InnerCircle which is a rectangle
| OrbMenu | ||
shape2LineStoke : Number
Defines linestoke of shape2. | OrbMenu | ||
shape2OutlineColor : uint
Sets the outline color of shape2
| OrbMenu | ||
![]() | slider : Slider | Menu | |
startAngle : Number
defines start angle for text
| OrbMenu | ||
![]() | state : Array
property states array
| ElementFactory | |
stopAngle : Number
defines stop angle for text
| OrbMenu | ||
textRadius : Number
defines radius of text
| OrbMenu | ||
textX : Number
defines the centerX position of text
| OrbMenu | ||
textY : Number
Defines centerY position of text
| OrbMenu | ||
![]() | top : Number
sets top value
| ElementFactory | |
![]() | verticalCenter : Number
sets the vertical center of display object
| ElementFactory | |
![]() | width : Number [override]
Sets width of the display object in pixels
| ElementFactory | |
![]() | widthPercent : String
sets the percent of width of display object
| ElementFactory |
Method | Defined By | ||
---|---|---|---|
OrbMenu()
Constructor. | OrbMenu | ||
![]() | addAllChildren():void
This method searches the childlist and add the children
| ContainerFactory | |
![]() | addChild(child:DisplayObject):DisplayObject [override]
Adds child to display list and, if not already added, the child list
TODO: This mechanism should be abstracted to better syncrhonize child and display lists
| Container | |
![]() | applyLayout(value:* = null):void
Apply the containers layout
| Container | |
![]() | childToList(id:String, child:*):void
this method append to the childlist
| ContainerFactory | |
![]() | clone():* [override]
Returns clone of self
| Menu | |
displayComplete():void [override]
CML display initialization callback
defines positions for buttons,lines and rectangle. | OrbMenu | ||
dispose():void [override]
Dispose methods to nullify attributes and remove listeners
| OrbMenu | ||
![]() | getIndex(index:int):*
returns childlist index
| Container | |
![]() | getKey(key:String):*
returns the childlist key
| Container | |
![]() | hideIndex(index:int):void
hides the childlist index
| Container | |
![]() | hideKey(key:String):void
hides the childlist key
| Container | |
init():void [override]
Initializes the configuration and display of orbMenu
| OrbMenu | ||
![]() | parseCML(cml:XMLList):XMLList [override]
Parse cml for local layouts. | Container | |
![]() | postparseCML(cml:XMLList):void
post parses the cml file
| ElementFactory | |
![]() | reset():void | Menu | |
![]() | searchChildren(value:*, returnType:Class = null):*
This method does a depth first search of childLists. | Container | |
![]() | setDimensionsToChild():void
This method sets the dimensions of childlist
| ContainerFactory | |
![]() | showIndex(index:int):void
shows the childlist index
| Container | |
![]() | showKey(key:String):void
shows the childlist key
| Container | |
![]() | startTimer():void
if autohide on, adds the listener
| Menu | |
![]() | updateLayout(containerWidth:Number, containerHeight:Number):void
sets the layout depending on the position
| Menu | |
![]() | updateProperties(state:Number = 0):void
this method updates the properties
| ElementFactory |
attractMode | property |
attractMode:Boolean
defines whether Orbmenu is floating or not
public function get attractMode():Boolean
public function set attractMode(value:Boolean):void
background | property |
public var background:Sprite
Defines background in rectangle shape of orbMenu.
backgroundColor | property |
backgroundColor:uint
Sets the background color
The default value is = 0x666666;
.
public function get backgroundColor():uint
public function set backgroundColor(value:uint):void
backgroundLineStoke | property |
backgroundLineStoke:uint
Sets the background line stoke
The default value is = 3;
.
public function get backgroundLineStoke():uint
public function set backgroundLineStoke(value:uint):void
backgroundOutlineColor | property |
backgroundOutlineColor:uint
Sets the background out line color
The default value is = 0x000000;
.
public function get backgroundOutlineColor():uint
public function set backgroundOutlineColor(value:uint):void
buttons | property |
public var buttons:Array
Defines array of buttons.
coverage | property |
coverage:Number
defines the coverage of text
public function get coverage():Number
public function set coverage(value:Number):void
curveText | property |
curveText:String
defines the text
public function get curveText():String
public function set curveText(value:String):void
dropshadow | property |
public var dropshadow:DropShadowFilter
Defines dropshadow filter for shape.
filtersArray | property |
public var filtersArray:Array
Defines array for drop shadow filter.
gradientAlphas | property |
gradientAlphas:String
Sets the alpha transparency of gradient for shapes
The default value is = [1, 1];
.
public function get gradientAlphas():String
public function set gradientAlphas(value:String):void
gradientColors | property |
gradientColors:String
Sets the array of color values of gradient for shapes
The default value is = [0x404040 , 0x404040];
.
public function get gradientColors():String
public function set gradientColors(value:String):void
gradientHeight | property |
gradientHeight:Number
the width (in pixels) to which the gradient will spread
The default value is = 100;
.
public function get gradientHeight():Number
public function set gradientHeight(value:Number):void
gradientRatios | property |
gradientRatios:String
Sets the ratios of gradient for shapes
The default value is = [0, 255];
.
public function get gradientRatios():String
public function set gradientRatios(value:String):void
gradientRotation | property |
gradientRotation:Number
the rotation (in radians) that will be applied to the gradient
The default value is = 0;
.
public function get gradientRotation():Number
public function set gradientRotation(value:Number):void
gradientType | property |
gradientType:String
Sets the gardient type for shapes
The default value is = GradientType.LINEAR;
.
public function get gradientType():String
public function set gradientType(value:String):void
gradientWidth | property |
gradientWidth:Number
the width (in pixels) to which the gradient will spread
The default value is = 50;
.
public function get gradientWidth():Number
public function set gradientWidth(value:Number):void
gradientX | property |
gradientX:Number
how far (in pixels) the gradient is shifted horizontally
The default value is = 25;
.
public function get gradientX():Number
public function set gradientX(value:Number):void
gradientY | property |
gradientY:Number
how far (in pixels) the gradient is shifted horizontally
The default value is = 0;
.
public function get gradientY():Number
public function set gradientY(value:Number):void
line | property |
public var line:Sprite
Defines intersection lines of background.
matrix | property |
public var matrix:Matrix
Defines to control gradient appearance of shapes.
orbRadius | property |
orbRadius:Number
Defines radius of orbmenu.
The default value is = 100;
.
public function get orbRadius():Number
public function set orbRadius(value:Number):void
repeatTimer | property |
repeatTimer:Number
number of times the timer will tick before the timer stops itself
The default value is = 1;
.
public function get repeatTimer():Number
public function set repeatTimer(value:Number):void
shape1 | property |
public var shape1:Sprite
Defines the OuterCircle which is a rectangle
shape1LineStoke | property |
shape1LineStoke:Number
Defines linestoke of shape1.
The default value is = 5;
.
public function get shape1LineStoke():Number
public function set shape1LineStoke(value:Number):void
shape1OutlineColor | property |
shape1OutlineColor:uint
Sets the outline color of shape1
The default value is = 0x000000;
.
public function get shape1OutlineColor():uint
public function set shape1OutlineColor(value:uint):void
shape2 | property |
public var shape2:Sprite
Defines the InnerCircle which is a rectangle
shape2LineStoke | property |
shape2LineStoke:Number
Defines linestoke of shape2.
The default value is = 4;
.
public function get shape2LineStoke():Number
public function set shape2LineStoke(value:Number):void
shape2OutlineColor | property |
shape2OutlineColor:uint
Sets the outline color of shape2
The default value is = 0x000000;
.
public function get shape2OutlineColor():uint
public function set shape2OutlineColor(value:uint):void
startAngle | property |
startAngle:Number
defines start angle for text
public function get startAngle():Number
public function set startAngle(value:Number):void
stopAngle | property |
stopAngle:Number
defines stop angle for text
public function get stopAngle():Number
public function set stopAngle(value:Number):void
textRadius | property |
textRadius:Number
defines radius of text
public function get textRadius():Number
public function set textRadius(value:Number):void
textX | property |
textX:Number
defines the centerX position of text
public function get textX():Number
public function set textX(value:Number):void
textY | property |
textY:Number
Defines centerY position of text
public function get textY():Number
public function set textY(value:Number):void
OrbMenu | () | Constructor |
public function OrbMenu()
Constructor.
displayComplete | () | method |
override public function displayComplete():void
CML display initialization callback defines positions for buttons,lines and rectangle.
dispose | () | method |
override public function dispose():void
Dispose methods to nullify attributes and remove listeners
init | () | method |
override public function init():void
Initializes the configuration and display of orbMenu