Package | com.gestureworks.cml.elements |
Class | public class Toggle |
Inheritance | Toggle ![]() ![]() |
var toggle:Toggle = new Toggle(); toggle.fillColor = 0x333333; toggle.backgroundLineColor = 0xFF0000; toggle.toggleLineStoke = 4; toggle.x = 100; toggle.y = 100; addChild(toggle); toggle.addEventListener(StateEvent.CHANGE, onToggle); var txt:TextElement = new TextElement; txt.text = "hello"; txt.x = 200; txt.y = 130; txt.visible = false; addChild(txt); function onToggle(event:StateEvent):void { trace("toggle text", event.value); if (event.value == "true") txt.visible = true; else txt.visible = false; }
Property | Defined By | ||
---|---|---|---|
![]() | autoShuffle : Boolean
autoshuffles
| TouchContainer | |
background : Sprite
Defines the square background
| Toggle | ||
backgroundColor : uint
Sets the inside color of the background
| Toggle | ||
backgroundLineAlpha : Number
Sets alpha of the background line
| Toggle | ||
backgroundLineColor : uint
Sets the color of the background line color
| Toggle | ||
backgroundLineStoke : Number
Sets the background Line Stoke
| Toggle | ||
![]() | childList : ChildList
Returns the object's childList. | TouchContainer | |
![]() | className : String
sets the class name of displayobject
| TouchContainer | |
![]() | cloneExclusions : Vector.<String> [read-only]
Returns a list of properties to exclude when cloning this object
| TouchContainer | |
![]() | cmlIndex : int
Returns the index created by the CML parser. | TouchContainer | |
![]() | dimensionsTo : Object
Sets the dimensions of TouchContainer to given object
| TouchContainer | |
![]() | dropShadow : Boolean
Sets the drop shadow effect
| TouchContainer | |
![]() | group : String | TouchContainer | |
height : Number [override]
Sets height of the display object in pixels
| Toggle | ||
![]() | heightPercent : Number
sets the height of the container
| TouchContainer | |
![]() | id : String
Returns the object's id. | TouchContainer | |
![]() | layout : *
specifies the type of layout
| TouchContainer | |
![]() | layoutList : Dictionary | TouchContainer | |
![]() | mouseChildren : Boolean [override]
sets the mousechildren value to true or false. | TouchContainer | |
![]() | paddingBottom : Number
Sets the number of pixels between the container's bottom border and the bottom of its content area. | TouchContainer | |
![]() | paddingLeft : Number
Sets the number of pixels between the component's left border and the left edge of its content area. | TouchContainer | |
![]() | paddingRight : Number
Sets the number of pixels between the component's right border and the right edge of its content area. | TouchContainer | |
![]() | paddingTop : Number
Sets the number of pixels between the container's top border and the top of its content area. | TouchContainer | |
![]() | position : *
Sets the position
| TouchContainer | |
![]() | relativeX : Boolean
When set true this containers children's x position will be laid out relatively
to each other. | TouchContainer | |
![]() | relativeY : Boolean
When set true this containers children's y position will be laid out relatively
to each other. | TouchContainer | |
![]() | sound : String | TouchContainer | |
![]() | state : Dictionary | TouchContainer | |
![]() | stateId : *
Returns the current state id. | TouchContainer | |
![]() | toBitmap : Boolean | TouchContainer | |
toggleColor : uint
Sets the toggle color of the background
| Toggle | ||
toggleGraphic : Sprite
The "x" graphic in the background
| Toggle | ||
toggleLineStoke : Number
Sets the toggle Line Stoke of the background
| Toggle | ||
value : Boolean
Sets the current toggle state
| Toggle | ||
width : Number [override]
Sets width of the display object in pixels
| Toggle | ||
![]() | widthPercent : Number
sets the width of the container
| TouchContainer |
Method | Defined By | ||
---|---|---|---|
Toggle()
Constructor
| Toggle | ||
![]() | activateTouch():void | TouchContainer | |
![]() | addAllChildren():void
method searches the child and adds to the list
| TouchContainer | |
![]() | addChild(child:DisplayObject):DisplayObject [override]
Adds child to display list and, if not already added, the child list
| TouchContainer | |
![]() | addChildAt(child:DisplayObject, index:int):DisplayObject [override]
Adds child to display list and, if not already added, the child list
| TouchContainer | |
![]() | applyLayout(value:* = null):void
Apply the containers layout
| TouchContainer | |
![]() | childToList(id:String, child:*):void
child appended to the childlist
| TouchContainer | |
![]() | clone():*
Clone method
| TouchContainer | |
dispose():void [override]
Destructor
| Toggle | ||
draw():void
Draws the background and x graphic in background
| Toggle | ||
![]() | getElementById(id:String):*
Searches CML childList by id. | TouchContainer | |
![]() | getElementsByClassName(className:String):Array
Searches the CML childList by className. | TouchContainer | |
![]() | getElementsByTagName(tagName:Class):Array
Searches the CML childList by tagName as Class. | TouchContainer | |
init():void [override]
Initializes the configuration and display of the toggle
| Toggle | ||
![]() | loadState(sId:* = null, recursion:Boolean = false):void
Loads state by index number. | TouchContainer | |
![]() | makeGestureList(value:XMLList):Object
Creates gestureList object from XML
| TouchContainer | |
![]() | parseCML(cml:XMLList):XMLList
Parse cml for local layouts. | TouchContainer | |
![]() | postparseCML(cml:XMLList):void
Abstract method allows the setting of a postparse CML routine. | TouchContainer | |
![]() | querySelector(selector:String):*
Searches the CML childList by selector. | TouchContainer | |
![]() | querySelectorAll(selector:*):Array
Search the CML childList by selector. | TouchContainer | |
![]() | removeChild(child:DisplayObject):DisplayObject [override]
Removes child from display list and, if not already removed, the child list
| TouchContainer | |
![]() | removeChildAt(index:int):DisplayObject [override]
Removes child from display list and, if not already removed, the child list
| TouchContainer | |
![]() | removeChildren(beginIndex:int = 0, endIndex:int = 2147483647):void [override]
Removes children from display list and, if not already removed, the child list
| TouchContainer | |
![]() | saveState(sId:* = null, recursion:Boolean = false):void
Save state by index number. | TouchContainer | |
![]() | searchChildren(value:*, returnType:Class = null):*
This method does a depth first search of childLists. | TouchContainer | |
![]() | setDimensionsToChild():void
method sets the dimensions of each child
| TouchContainer | |
![]() | tweenState(sId:* = null, tweenTime:Number = 1):void
Tween state by stateIndex from current to given state index. | TouchContainer | |
![]() | updatePadding():void
Updates child padding within this container
| TouchContainer | |
![]() | updatePercentDim():void
Updates child percent dimensions within this container
| TouchContainer | |
![]() | updateProperties(state:* = 0):void
Updates properties from state. | TouchContainer | |
![]() | updateRelativePos():void
Updates child relative positions within this container
| TouchContainer |
background | property |
public var background:Sprite
Defines the square background
backgroundColor | property |
backgroundColor:uint
Sets the inside color of the background
The default value is 0x333333
.
public function get backgroundColor():uint
public function set backgroundColor(value:uint):void
backgroundLineAlpha | property |
backgroundLineAlpha:Number
Sets alpha of the background line
The default value is 100
.
public function get backgroundLineAlpha():Number
public function set backgroundLineAlpha(value:Number):void
backgroundLineColor | property |
backgroundLineColor:uint
Sets the color of the background line color
The default value is 0x00ff00
.
public function get backgroundLineColor():uint
public function set backgroundLineColor(value:uint):void
backgroundLineStoke | property |
backgroundLineStoke:Number
Sets the background Line Stoke
The default value is 1
.
public function get backgroundLineStoke():Number
public function set backgroundLineStoke(value:Number):void
height | property |
height:Number
[override] Sets height of the display object in pixels
The default value is 100
.
public function get height():Number
public function set height(value:Number):void
toggleColor | property |
toggleColor:uint
Sets the toggle color of the background
The default value is 0x00FF00
.
public function get toggleColor():uint
public function set toggleColor(value:uint):void
toggleGraphic | property |
public var toggleGraphic:Sprite
The "x" graphic in the background
toggleLineStoke | property |
toggleLineStoke:Number
Sets the toggle Line Stoke of the background
The default value is 1
.
public function get toggleLineStoke():Number
public function set toggleLineStoke(value:Number):void
value | property |
value:Boolean
Sets the current toggle state
The default value is false
.
public function get value():Boolean
public function set value(value:Boolean):void
width | property |
width:Number
[override] Sets width of the display object in pixels
The default value is 100
.
public function get width():Number
public function set width(value:Number):void
Toggle | () | Constructor |
public function Toggle()
Constructor
dispose | () | method |
override public function dispose():void
Destructor
draw | () | method |
public function draw():void
Draws the background and x graphic in background
init | () | method |
override public function init():void
Initializes the configuration and display of the toggle