Packagecom.gestureworks.cml.elements
Classpublic class Key
InheritanceKey Inheritance Button Inheritance Container Inheritance TouchContainer Inheritance com.gestureworks.core.TouchSprite

The key element simulates a key on a keyboard by dispatching a keyboard event, containing the assigned character and key unicode values, when touched.
        
        var ke:Key = new Key();
        ke.text = "a";
        ke.init();
        addChild(ke);
      
     

See also

TouchKeyboard
Button


Public Properties
 PropertyDefined By
 InheritedautoShuffle : Boolean
autoshuffles
TouchContainer
  capsOn : Boolean
A flag indicating the "capitalized" state of the text.
Key
  charCode : uint
The character code (unicode) value of the key pressed
Key
 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
 Inheriteddebug : Boolean = false
Button
 InheriteddimensionsTo : Object
Sets the dimensions of TouchContainer to given object
TouchContainer
 Inheriteddispatch : String
Assigns a message to dispatch with a button state event.
Button
 InheriteddispatchDefault : Boolean = false
Button
 Inheriteddown : *
Sets button state association with down event
Button
  downTextColor : uint
The color of the text when touched down
Key
 InheriteddropShadow : Boolean
Sets the drop shadow effect
TouchContainer
 Inheritedgroup : String
TouchContainer
 Inheritedheight : Number
[override] sets the height of the container
TouchContainer
 InheritedheightPercent : Number
sets the height of the container
TouchContainer
 InheritedhideOnToggle : Boolean
Specifies whether buttons will hide on a toggle event.
Button
 Inheritedhit : *
The hit object is the object recieving the input events
Button
  icon : *
The icon displayed on the key element
Key
 Inheritedid : String
Returns the object's id.
TouchContainer
 Inheritedinitial : *
Sets the initial button state object
Button
  initTextColor : uint
The inital text color
Key
  keyCode : uint
The key code (unicode) value of the key pressed
Key
 Inheritedlayout : *
specifies the type of layout
TouchContainer
 InheritedlayoutList : Dictionary
TouchContainer
 InheritedmouseChildren : Boolean
[override] sets the mousechildren value to true or false.
TouchContainer
 InheritedmouseDown : *
Sets button state association with mouse down event
Button
 InheritedmouseOut : *
Sets button state association with mouse out event
Button
 InheritedmouseOver : *
Sets button state association with mouse over event
Button
 InheritedmouseUp : *
Sets button state association with mouse up event
Button
 Inheritedout : *
Sets button state association with out event
Button
  outputText : Boolean
Instructs the TouchKeyboard to bypass the KeyboardEvent evaluation and output the text instead.
Key
  outTextColor : uint
The text color when touched out
Key
 Inheritedover : *
Sets button state association with over event (mouse only)
Button
  overTextColor : uint
The text color when touched over
Key
 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
  shiftCharCode : uint
The character code (unicode) value of the key pressed while in a shift state
Key
  shiftOn : Boolean
A flag indicating the shift state of the text.
Key
  shiftText : String
The text displayed on the key while in a shift state
Key
 Inheritedside : String
Attaches an event string to a button to listen for to toggle visibility when that event is dispatched.
Button
 Inheritedsound : String
TouchContainer
 Inheritedstate : Dictionary
TouchContainer
 InheritedstateId : *
Returns the current state id.
TouchContainer
 Inheritedtap : *
Sets the button state association with tap event.
Button
  text : *
The text displayed on the key
Key
 InheritedtoBitmap : Boolean
TouchContainer
 Inheritedtoggle : String
An alternative to button state events, the toggle displays the next child at each event defined by the toggle value (e.g.
Button
 InheritedtouchDown : *
Sets button state association with touch down event
Button
 InheritedtouchOut : *
Sets button state association with touch out event
Button
 InheritedtouchOver : *
Sets button state association with touch out event
Button
 InheritedtouchUp : *
Sets button state association with touch up event
Button
 Inheritedup : *
Sets button state association with up event
Button
  upTextColor : uint
The text color when touched up
Key
 Inheritedwidth : Number
[override] sets the width of the container
TouchContainer
 InheritedwidthPercent : Number
sets the width of the container
TouchContainer
Protected Properties
 PropertyDefined By
 InheritedbuttonStates : Array
Button
 InheritedcmlGestureList : Object
TouchContainer
Public Methods
 MethodDefined By
  
Key()
Constructor
Key
 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():*
[override] Returns clone of self
Button
  
dispose():void
[override] Destructor
Key
 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
  
init():void
[override] Initialization function
Key
 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
 Inherited
Button
 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
reset():void
Button
 Inherited
runToggle():void
Button
 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
  
setup():void
Setup object
Key
 Inherited
tweenState(sId:* = null, tweenTime:Number = 1):void
Tween state by stateIndex from current to given state index.
TouchContainer
 Inherited
Updates dimensions
Button
 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
  
onDown(event:*):void
[override] The down event handler.
Key
 Inherited
onMouseDown(event:*):void
Processes the mouse down event by displaying the mouseDown state and hiding the other states.
Button
 Inherited
onMouseOut(event:*):void
Processes the mouse out event by displaying the mouseOut state and hiding the other states.
Button
 Inherited
onMouseOver(event:*):void
Processes the mouse over event by displaying the mouseOver state and hiding the other states.
Button
 Inherited
onMouseUp(event:*):void
Processes the mouse up event by displaying the mouseUp state and hiding the other states.
Button
  
onOut(event:*):void
[override] The out event handler.
Key
  
onOver(event:*):void
[override] The over event handler.
Key
 Inherited
onTap(event:*):void
Button
 Inherited
onToggle(event:*):void
Displays the the next child on the specified button event.
Button
 Inherited
onTouchBegin(event:*):void
Processes the touch down event by displaying the touchDown state and hiding the other states.
Button
 Inherited
onTouchOut(event:*):void
Processes the touch out event by displaying the touchOut state and hiding the other states.
Button
 Inherited
onTouchOver(event:*):void
Processes the touch over event by displaying the touchOver state and hiding the other states.
Button
 Inherited
onTouchUp(event:*):void
Processes the touch up event by displaying the touchUp state and hiding the other states.
Button
  
onUp(event:*):void
[override] The up event handler.
Key
Property Detail
capsOnproperty
capsOn:Boolean

A flag indicating the "capitalized" state of the text. Only valid for letter characters.


Implementation
    public function get capsOn():Boolean
    public function set capsOn(value:Boolean):void
charCodeproperty 
charCode:uint

The character code (unicode) value of the key pressed


Implementation
    public function get charCode():uint
    public function set charCode(value:uint):void
downTextColorproperty 
downTextColor:uint

The color of the text when touched down


Implementation
    public function get downTextColor():uint
    public function set downTextColor(value:uint):void
iconproperty 
icon:*

The icon displayed on the key element


Implementation
    public function get icon():*
    public function set icon(value:any):void
initTextColorproperty 
initTextColor:uint

The inital text color


Implementation
    public function get initTextColor():uint
    public function set initTextColor(value:uint):void
keyCodeproperty 
keyCode:uint

The key code (unicode) value of the key pressed


Implementation
    public function get keyCode():uint
    public function set keyCode(value:uint):void
outputTextproperty 
outputText:Boolean

Instructs the TouchKeyboard to bypass the KeyboardEvent evaluation and output the text instead. This is a useful setting for key text without valid character or key codes. For example, setting this flag on a key having a text value of '.com', will output '.com' in the designated text field.


Implementation
    public function get outputText():Boolean
    public function set outputText(value:Boolean):void
outTextColorproperty 
outTextColor:uint

The text color when touched out


Implementation
    public function get outTextColor():uint
    public function set outTextColor(value:uint):void
overTextColorproperty 
overTextColor:uint

The text color when touched over


Implementation
    public function get overTextColor():uint
    public function set overTextColor(value:uint):void
shiftCharCodeproperty 
shiftCharCode:uint

The character code (unicode) value of the key pressed while in a shift state


Implementation
    public function get shiftCharCode():uint
    public function set shiftCharCode(value:uint):void
shiftOnproperty 
shiftOn:Boolean

A flag indicating the shift state of the text. Any key can have a text value for a shift state and one for the initial state.


Implementation
    public function get shiftOn():Boolean
    public function set shiftOn(value:Boolean):void
shiftTextproperty 
shiftText:String

The text displayed on the key while in a shift state


Implementation
    public function get shiftText():String
    public function set shiftText(value:String):void
textproperty 
text:*

The text displayed on the key


Implementation
    public function get text():*
    public function set text(value:any):void
upTextColorproperty 
upTextColor:uint

The text color when touched up


Implementation
    public function get upTextColor():uint
    public function set upTextColor(value:uint):void
Constructor Detail
Key()Constructor
public function Key()

Constructor

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

Destructor

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

Initialization function

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

The down event handler. Dispatches a KEY_DOWN event containing the character key codes. The key location has an arbitrary value (10) to identify its origin.

Parameters

event:* — event triggered when touched/clicked

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

The out event handler.

Parameters

event:* — event triggered when a key is released from an over event

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

The over event handler.

Parameters

event:* — event triggered when a key is intersected from outside

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

The up event handler.

Parameters

event:* — event triggered when a key is released from a down event

setup()method 
public function setup():void

Setup object