Packagecom.gestureworks.cml.elements
Classpublic class MaskContainer
InheritanceMaskContainer Inheritance TouchContainer Inheritance com.gestureworks.core.TouchSprite

The MaskContainer element takes in one or multiple images and applies a mask designated in CML to all images in its child list. If there are multiple images, the class automatically cycles through them using double-tap. The gesture may be turned off in CML. This element is touch-enabled already, and does not need to be wrapped in a touchContainer.
     
       var maskContainer:MaskContainer = new MaskContainer();
        maskContainer.maskShape = "rectangle";
        maskContainer.maskWidth = 100;
        maskContainer.maskHeight = 64;
        maskContainer.maskBorderColor = 0xff0000;
        maskContainer.maskBorderStroke = 2;
        maskContainer.maskBorderAlpha = 0.75;
        
        maskContainer.addChild(img);
        maskContainer.childToList("image", img);
        maskContainer.init();
     
     

See also

TouchContainer


Public Properties
 PropertyDefined By
 InheritedautoShuffle : Boolean
autoshuffles
TouchContainer
 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
  counter : Number
[read-only]
MaskContainer
 InheriteddimensionsTo : Object
Sets the dimensions of TouchContainer to given object
TouchContainer
  dragAngle : Number
MaskContainer
 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
 Inheritedid : String
Returns the object's id.
TouchContainer
 Inheritedlayout : *
specifies the type of layout
TouchContainer
 InheritedlayoutList : Dictionary
TouchContainer
  maskBorderAlpha : Number
Alpha for the border of the mask if desired.
MaskContainer
  maskBorderColor : uint
Mask border color, if a border is desired around the mask element.
MaskContainer
  maskBorderStroke : Number
The thickness of the border in pixels.
MaskContainer
  maskHeight : Number
Mask height for rectangles.
MaskContainer
  maskRadius : Number
The property for the mask radius if the shape is a circle.
MaskContainer
  maskRotation : Number
Set the starting rotation of the mask.
MaskContainer
  maskShape : String
The string property to designate the shape the mask will be.
MaskContainer
  maskWidth : Number
Mask width for rectangles.
MaskContainer
  maskX : Number
Set the mask's starting X position.
MaskContainer
  maskY : Number
Set the mask's starting Y position.
MaskContainer
 InheritedmouseChildren : Boolean
[override] sets the mousechildren value to true or false.
TouchContainer
  mShape : Graphic
[read-only]
MaskContainer
 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
 Inheritedsound : String
TouchContainer
 Inheritedstate : Dictionary
TouchContainer
 InheritedstateId : *
Returns the current state id.
TouchContainer
 InheritedtoBitmap : Boolean
TouchContainer
  touchScreen : TouchContainer
[read-only]
MaskContainer
 Inheritedwidth : Number
[override] sets the width of the container
TouchContainer
 InheritedwidthPercent : Number
sets the width of the container
TouchContainer
Protected Properties
 PropertyDefined By
  borderShape : Graphic
MaskContainer
 InheritedcmlGestureList : Object
TouchContainer
  graphicArray : List
MaskContainer
  hitShape : Graphic
MaskContainer
  _mShape : Graphic
MaskContainer
  overallMask : Graphic
MaskContainer
  _touchScreen : TouchContainer
MaskContainer
  wShape : Graphic
MaskContainer
Public Methods
 MethodDefined By
  
Constructor
MaskContainer
 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
  
alphaHandler(e:GWGestureEvent):void
MaskContainer
  
alphaShift(n:Number):void
MaskContainer
 Inherited
applyLayout(value:* = null):void
Apply the containers layout
TouchContainer
 Inherited
childToList(id:String, child:*):void
child appended to the childlist
TouchContainer
 Inherited
clone():*
Clone method
TouchContainer
  
cycleMasks(e:GWGestureEvent = null):void
cycles through multiple images
MaskContainer
  
dispose():void
[override] Destructor
MaskContainer
 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] Initialisation method
MaskContainer
 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
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
  
reset():void
MaskContainer
 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
 Inherited
tweenState(sId:* = null, tweenTime:Number = 1):void
Tween state by stateIndex from current to given state index.
TouchContainer
 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
Property Detail
_mShapeproperty
protected var _mShape:Graphic

_touchScreenproperty 
protected var _touchScreen:TouchContainer

borderShapeproperty 
protected var borderShape:Graphic

counterproperty 
counter:Number  [read-only]


Implementation
    public function get counter():Number
dragAngleproperty 
dragAngle:Number


Implementation
    public function get dragAngle():Number
    public function set dragAngle(value:Number):void
graphicArrayproperty 
protected var graphicArray:List

hitShapeproperty 
protected var hitShape:Graphic

maskBorderAlphaproperty 
maskBorderAlpha:Number

Alpha for the border of the mask if desired. Must be set between 0 and 1 to be visible.

The default value is 0;.


Implementation
    public function get maskBorderAlpha():Number
    public function set maskBorderAlpha(value:Number):void
maskBorderColorproperty 
maskBorderColor:uint

Mask border color, if a border is desired around the mask element.

The default value is 0x000000;.


Implementation
    public function get maskBorderColor():uint
    public function set maskBorderColor(value:uint):void
maskBorderStrokeproperty 
maskBorderStroke:Number

The thickness of the border in pixels.

The default value is 0;.


Implementation
    public function get maskBorderStroke():Number
    public function set maskBorderStroke(value:Number):void
maskHeightproperty 
maskHeight:Number

Mask height for rectangles.


Implementation
    public function get maskHeight():Number
    public function set maskHeight(value:Number):void
maskRadiusproperty 
maskRadius:Number

The property for the mask radius if the shape is a circle.


Implementation
    public function get maskRadius():Number
    public function set maskRadius(value:Number):void
maskRotationproperty 
maskRotation:Number

Set the starting rotation of the mask.


Implementation
    public function get maskRotation():Number
    public function set maskRotation(value:Number):void
maskShapeproperty 
maskShape:String

The string property to designate the shape the mask will be. "rectangle" or "circle" are options.


Implementation
    public function get maskShape():String
    public function set maskShape(value:String):void
maskWidthproperty 
maskWidth:Number

Mask width for rectangles.


Implementation
    public function get maskWidth():Number
    public function set maskWidth(value:Number):void
maskXproperty 
maskX:Number

Set the mask's starting X position.


Implementation
    public function get maskX():Number
    public function set maskX(value:Number):void
maskYproperty 
maskY:Number

Set the mask's starting Y position.


Implementation
    public function get maskY():Number
    public function set maskY(value:Number):void
mShapeproperty 
mShape:Graphic  [read-only]


Implementation
    public function get mShape():Graphic
overallMaskproperty 
protected var overallMask:Graphic

touchScreenproperty 
touchScreen:TouchContainer  [read-only]


Implementation
    public function get touchScreen():TouchContainer
wShapeproperty 
protected var wShape:Graphic

Constructor Detail
MaskContainer()Constructor
public function MaskContainer()

Constructor

Method Detail
alphaHandler()method
public function alphaHandler(e:GWGestureEvent):void

Parameters

e:GWGestureEvent

alphaShift()method 
public function alphaShift(n:Number):void

Parameters

n:Number

cycleMasks()method 
public function cycleMasks(e:GWGestureEvent = null):void

cycles through multiple images

Parameters

e:GWGestureEvent (default = null)

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

Destructor

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

Initialisation method

reset()method 
public function reset():void