| Package | com.gestureworks.cml.element |
| Class | public class Toggle |
| Inheritance | Toggle ElementFactory flash.display.Sprite |
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 | ||
|---|---|---|---|
![]() | alpha : Number [override] [write-only]
sets the alpha for display objects
| ElementFactory | |
| background : Sprite
Defines the square background
| Toggle | ||
| backgroundColor : uint
Sets the inside color of the background
| Toggle | ||
| backgroundLineColor : uint
Sets the color of the background line color
| Toggle | ||
| backgroundLineStoke : Number
Sets the background Line Stoke
| Toggle | ||
![]() | blur : Boolean
Sets the drop shadow effect
| ElementFactory | |
![]() | bottom : Number
sets the bottom value
| ElementFactory | |
![]() | class_ : String
Object's css class;
| ElementFactory | |
![]() | className : String
sets the class name of displayobject
| ElementFactory | |
![]() | cmlIndex : int
sets the cml index
| ElementFactory | |
![]() | debugStyle : *
sets the debug style
| ElementFactory | |
![]() | displayEvents : String
Use for dispatch completes. | ElementFactory | |
![]() | dropShadow : Boolean
Sets the drop shadow effect
| ElementFactory | |
![]() | 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 | |
![]() | left : Number
sets left value
| ElementFactory | |
![]() | propertyStates : Array Deprecated: Please Use state | ElementFactory | |
![]() | 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 | |
![]() | state : Array
property states array
| ElementFactory | |
| 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 | ||
![]() | 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 | ||
|---|---|---|---|
Toggle()
Constructor
| Toggle | ||
![]() | clone():*
Returns clone of self
| ElementFactory | |
displayComplete():void [override]
CML display initialization callback
| Toggle | ||
dispose():void [override]
Dispose method
| Toggle | ||
draw():void
Draws the background and x graphic in background
| Toggle | ||
init():void [override]
Initializes the configuration and display of the toggle
| Toggle | ||
![]() | parseCML(cml:XMLList):XMLList
parses cml file
| ElementFactory | |
![]() | postparseCML(cml:XMLList):void
post parses the cml file
| ElementFactory | |
![]() | updateProperties(state:Number = 0):void
this method updates the properties
| ElementFactory | |
| background | property |
public var background:SpriteDefines the square background
| backgroundColor | property |
backgroundColor:uintSets the inside color of the background
The default value is 0x333333.
public function get backgroundColor():uint public function set backgroundColor(value:uint):void| backgroundLineColor | property |
backgroundLineColor:uintSets 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:NumberSets the background Line Stoke
The default value is 1.
public function get backgroundLineStoke():Number public function set backgroundLineStoke(value:Number):void| toggleColor | property |
toggleColor:uintSets 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:SpriteThe "x" graphic in the background
| toggleLineStoke | property |
toggleLineStoke:NumberSets the toggle Line Stoke of the background
The default value is 1.
public function get toggleLineStoke():Number public function set toggleLineStoke(value:Number):void| Toggle | () | Constructor |
public function Toggle()Constructor
| displayComplete | () | method |
override public function displayComplete():voidCML display initialization callback
| dispose | () | method |
override public function dispose():voidDispose method
| draw | () | method |
public function draw():voidDraws the background and x graphic in background
| init | () | method |
override public function init():voidInitializes the configuration and display of the toggle