Packagecom.gestureworks.cml.elements
Classpublic class TouchContainer
InheritanceTouchContainer Inheritance com.gestureworks.core.TouchSprite
Implements IContainer, ICSS, IState
Subclasses Accordion, Album, Attract, Background, ColorPicker, Component, Container, DatePicker, Dial, DropDownMenu, FlickrQuery, FlipBook, GestureList, Gigapixel, Graphic, Image, LiveVideo, Magnifier, MaskContainer, Media, Menu, ModestMap, ModestMapMarker, MP3, Paint, Preloader, RadialSlider, RadioButtons, ScrollBar, ScrollPane, SlideMenu, Slider, Slideshow, Stack, StageKit, Stepper, SVG, SWC, SWF, Switch, Tab, TabbedContainer, Text, TLF, Toggle, TouchKeyboard, Video, View, WAV, YouTube

TouchContainer can be used to create interative display containers. It is the CML version of TouchSprite. It keeps track of children through the childlist property.

        var tc:TouchContainer = new TouchContainer();
        
        tc.x = 700;
        tc.y = 300;
        tc.alpha = .25;
        tc.scale = 1;
        
        //touch interactions
        tc.gestureList = { "n-drag":true, "n-scale":true, "n-rotate":true };
        
        //loading an image through image element
        var img:Image = new Image();
        img.open("orchid.jpg");
        img.x = 0;
        img.y = 0;
        img.width = 200;
        img.rotation = -20;
        img.id = "img1";
        img.scale = 2;
        tc.addChild(img);
        
        //initialise touch container
        tc.init();
        addChild(tc);
        
     

See also

Container
Gesture
GestureList


Public Properties
 PropertyDefined By
  autoShuffle : Boolean
autoshuffles
TouchContainer
  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 the height of the container
TouchContainer
  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
  width : Number
[override] sets the width of the container
TouchContainer
  widthPercent : Number
sets the width of the container
TouchContainer
Protected Properties
 PropertyDefined By
  cmlGestureList : Object
TouchContainer
Public Methods
 MethodDefined By
  
TouchContainer(_vto:Object = null)
Constructor
TouchContainer
  
TouchContainer
  
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
TouchContainer
  
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
Initialisation method
TouchContainer
  
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
  
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
  
Updates child padding within this container
TouchContainer
  
Updates child percent dimensions within this container
TouchContainer
  
updateProperties(state:* = 0):void
Updates properties from state.
TouchContainer
  
Updates child relative positions within this container
TouchContainer
Property Detail
autoShuffleproperty
autoShuffle:Boolean

autoshuffles


Implementation
    public function get autoShuffle():Boolean
    public function set autoShuffle(value:Boolean):void
childListproperty 
childList:ChildList

Returns the object's childList.


Implementation
    public function get childList():ChildList
    public function set childList(value:ChildList):void
classNameproperty 
className:String

sets the class name of displayobject


Implementation
    public function get className():String
    public function set className(value:String):void
cloneExclusionsproperty 
cloneExclusions:Vector.<String>  [read-only]

Returns a list of properties to exclude when cloning this object


Implementation
    public function get cloneExclusions():Vector.<String>
cmlGestureListproperty 
protected var cmlGestureList:Object

cmlIndexproperty 
cmlIndex:int

Returns the index created by the CML parser.


Implementation
    public function get cmlIndex():int
    public function set cmlIndex(value:int):void
dimensionsToproperty 
dimensionsTo:Object

Sets the dimensions of TouchContainer to given object


Implementation
    public function get dimensionsTo():Object
    public function set dimensionsTo(value:Object):void
dropShadowproperty 
dropShadow:Boolean

Sets the drop shadow effect

The default value is false.


Implementation
    public function get dropShadow():Boolean
    public function set dropShadow(value:Boolean):void
groupproperty 
group:String


Implementation
    public function get group():String
    public function set group(value:String):void
heightproperty 
height:Number[override]

sets the height of the container


Implementation
    public function get height():Number
    public function set height(value:Number):void
heightPercentproperty 
heightPercent:Number

sets the height of the container


Implementation
    public function get heightPercent():Number
    public function set heightPercent(value:Number):void
idproperty 
id:String

Returns the object's id.


Implementation
    public function get id():String
    public function set id(value:String):void
layoutproperty 
layout:*

specifies the type of layout


Implementation
    public function get layout():*
    public function set layout(value:any):void
layoutListproperty 
public var layoutList:Dictionary

mouseChildrenproperty 
mouseChildren:Boolean[override]

sets the mousechildren value to true or false.


Implementation
    public function get mouseChildren():Boolean
    public function set mouseChildren(value:Boolean):void
paddingBottomproperty 
paddingBottom:Number

Sets the number of pixels between the container's bottom border and the bottom of its content area.

The default value is 0.


Implementation
    public function get paddingBottom():Number
    public function set paddingBottom(value:Number):void
paddingLeftproperty 
paddingLeft:Number

Sets the number of pixels between the component's left border and the left edge of its content area.

The default value is 0.


Implementation
    public function get paddingLeft():Number
    public function set paddingLeft(value:Number):void
paddingRightproperty 
paddingRight:Number

Sets the number of pixels between the component's right border and the right edge of its content area.

The default value is 0.


Implementation
    public function get paddingRight():Number
    public function set paddingRight(value:Number):void
paddingTopproperty 
paddingTop:Number

Sets the number of pixels between the container's top border and the top of its content area.

The default value is 0.


Implementation
    public function get paddingTop():Number
    public function set paddingTop(value:Number):void
positionproperty 
position:*

Sets the position


Implementation
    public function get position():*
    public function set position(value:any):void
relativeXproperty 
relativeX:Boolean

When set true this containers children's x position will be laid out relatively to each other.


Implementation
    public function get relativeX():Boolean
    public function set relativeX(value:Boolean):void
relativeYproperty 
relativeY:Boolean

When set true this containers children's y position will be laid out relatively to each other.


Implementation
    public function get relativeY():Boolean
    public function set relativeY(value:Boolean):void
soundproperty 
sound:String


Implementation
    public function get sound():String
    public function set sound(value:String):void
stateproperty 
public var state:Dictionary

stateIdproperty 
stateId:*

Returns the current state id.


Implementation
    public function get stateId():*
    public function set stateId(value:any):void
toBitmapproperty 
toBitmap:Boolean


Implementation
    public function get toBitmap():Boolean
    public function set toBitmap(value:Boolean):void
widthproperty 
width:Number[override]

sets the width of the container


Implementation
    public function get width():Number
    public function set width(value:Number):void
widthPercentproperty 
widthPercent:Number

sets the width of the container


Implementation
    public function get widthPercent():Number
    public function set widthPercent(value:Number):void
Constructor Detail
TouchContainer()Constructor
public function TouchContainer(_vto:Object = null)

Constructor

Parameters
_vto:Object (default = null)
Method Detail
activateTouch()method
public function activateTouch():void

addAllChildren()method 
public function addAllChildren():void

method searches the child and adds to the list

addChild()method 
override public function addChild(child:DisplayObject):DisplayObject

Adds child to display list and, if not already added, the child list

Parameters

child:DisplayObject

Returns
DisplayObject
addChildAt()method 
override public function addChildAt(child:DisplayObject, index:int):DisplayObject

Adds child to display list and, if not already added, the child list

Parameters

child:DisplayObject
 
index:int

Returns
DisplayObject
applyLayout()method 
public function applyLayout(value:* = null):void

Apply the containers layout

Parameters

value:* (default = null)

childToList()method 
public function childToList(id:String, child:*):void

child appended to the childlist

Parameters

id:String
 
child:*

clone()method 
public function clone():*

Clone method

Returns
*
dispose()method 
override public function dispose():void

Destructor

getElementById()method 
public function getElementById(id:String):*

Searches CML childList by id. The first object is returned.

Parameters

id:String

Returns
*
getElementsByClassName()method 
public function getElementsByClassName(className:String):Array

Searches the CML childList by className. An array of objects are returned.

Parameters

className:String

Returns
Array
getElementsByTagName()method 
public function getElementsByTagName(tagName:Class):Array

Searches the CML childList by tagName as Class. An array of objects are returned.

Parameters

tagName:Class

Returns
Array
init()method 
public function init():void

Initialisation method

loadState()method 
public function loadState(sId:* = null, recursion:Boolean = false):void

Loads state by index number. If the first parameter is NaN, the current state will be saved.

Parameters

sId:* (default = null) — State index to be loaded.
 
recursion:Boolean (default = false) — If true the state will load recursively through the display list starting at current display ojbect.

makeGestureList()method 
public function makeGestureList(value:XMLList):Object

Creates gestureList object from XML

Parameters

value:XMLList

Returns
Object
parseCML()method 
public function parseCML(cml:XMLList):XMLList

Parse cml for local layouts.

Parameters

cml:XMLList

Returns
XMLList
postparseCML()method 
public function postparseCML(cml:XMLList):void

Abstract method allows the setting of a postparse CML routine.

Parameters

cml:XMLList

querySelector()method 
public function querySelector(selector:String):*

Searches the CML childList by selector. The first object is returned.

Parameters

selector:String

Returns
*
querySelectorAll()method 
public function querySelectorAll(selector:*):Array

Search the CML childList by selector. An array of objects are returned.

Parameters

selector:*

Returns
Array
removeChild()method 
override public function removeChild(child:DisplayObject):DisplayObject

Removes child from display list and, if not already removed, the child list

Parameters

child:DisplayObject

Returns
DisplayObject
removeChildAt()method 
override public function removeChildAt(index:int):DisplayObject

Removes child from display list and, if not already removed, the child list

Parameters

index:int

Returns
DisplayObject
removeChildren()method 
override public function removeChildren(beginIndex:int = 0, endIndex:int = 2147483647):void

Removes children from display list and, if not already removed, the child list

Parameters

beginIndex:int (default = 0)
 
endIndex:int (default = 2147483647)

saveState()method 
public function saveState(sId:* = null, recursion:Boolean = false):void

Save state by index number. If the first parameter is NaN, the current state will be saved.

Parameters

sId:* (default = null) — State index to save.
 
recursion:Boolean (default = false) — If true the state will save recursively through the display list starting at current display ojbect.

searchChildren()method 
public function searchChildren(value:*, returnType:Class = null):*

This method does a depth first search of childLists. Search parameter can be a simple CSS selector (id or class) or AS3 Class. If found, a corresponding display object is returned, if not, null is returned. The first occurrance that matches the parameter is returned, unless a returnType of Array (as class) is given;

Parameters

value:*
 
returnType:Class (default = null)

Returns
*
setDimensionsToChild()method 
public function setDimensionsToChild():void

method sets the dimensions of each child

tweenState()method 
public function tweenState(sId:* = null, tweenTime:Number = 1):void

Tween state by stateIndex from current to given state index. If the first parameter is null, the current state will be saved.

Parameters

sId:* (default = null) — State index to tween.
 
tweenTime:Number (default = 1) — Duration of tween

updatePadding()method 
public function updatePadding():void

Updates child padding within this container

updatePercentDim()method 
public function updatePercentDim():void

Updates child percent dimensions within this container

updateProperties()method 
public function updateProperties(state:* = 0):void

Updates properties from state.

Parameters

state:* (default = 0)

updateRelativePos()method 
public function updateRelativePos():void

Updates child relative positions within this container