Packagecom.gestureworks.cml.elements
Classpublic class Album
InheritanceAlbum Inheritance TouchContainer Inheritance com.gestureworks.core.TouchSprite
Subclasses MenuAlbum

The Album element provides a list of display objects that can be scrolled horizontally or vertically using a drag gesture. It supports tweening and item snapping.
     
        // horizontal album
        var h_album:AlbumElement = new AlbumElement();
        h_album.addChild(getImageElement("assets/wb3.jpg"));
        h_album.addChild(getImageElement("assets/USS_Macon_over_Manhattan.png"));
        h_album.addChild(getImageElement("assets/wb3.jpg"));
        h_album.init();

        // vertical album
        var v_album:AlbumElement = new AlbumElement();
        v_album.horizontal = false;            
        v_album.addChild(getImageElement("assets/wb3.jpg"));
        v_album.addChild(getImageElement("assets/USS_Macon_over_Manhattan.png"));                        
        v_album.addChild(getImageElement("assets/wb3.jpg"));            
        v_album.init();
    
    // the supporting method getImageElement("src"), returns a Image display
    // object.
            
     

See also

TouchContainer


Public Properties
 PropertyDefined By
  applyMask : Boolean
Flag indicating whether the contents are masked
Album
 InheritedautoShuffle : Boolean
autoshuffles
TouchContainer
  backgroundAlpha : Number
The alpha of the ablum's background
Album
  backgroundColor : uint
The color of the album's background
Album
  belt : TouchContainer
[read-only] The primary container and interactive object
Album
  centerContent : Boolean
Flag indicating the album items should be centered horizontally and vertically
Album
 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
  clusterBubbling : Boolean
[override] [write-only] Redirect clusterBubbling setting to the belt
Album
 InheritedcmlIndex : int
Returns the index created by the CML parser.
TouchContainer
  currentIndex : Number
[read-only] Returns the index of the current snap point
Album
  currentObject : *
[read-only] Returns the current object
Album
 InheriteddimensionsTo : Object
Sets the dimensions of TouchContainer to given object
TouchContainer
  dragAngle : Number
Intended to account for the rotation of the parent object to apply to drag transformations.
Album
  dragGesture : String
Specifies the GML drag gesture of the belt (e.g.
Album
 InheriteddropShadow : Boolean
Sets the drop shadow effect
TouchContainer
  flickGesture : String
Specifies the GML flick gesture (e.g.
Album
 Inheritedgroup : String
TouchContainer
  height : Number
[override] Sets the height of the container and associated mask
Album
 InheritedheightPercent : Number
sets the height of the container
TouchContainer
  horizontal : Boolean
Flag indicating the scroll axis
Album
 Inheritedid : String
Returns the object's id.
TouchContainer
  layout : *
[override] The album element is intended for a ListLayout only.
Album
 InheritedlayoutList : Dictionary
TouchContainer
  loop : Boolean
A flag instructing the album to continuously cycle through the objects opposed to stopping at the beginning or end.
Album
  loopQueue : Array
[read-only] The queue storing the order of children in the loop from head to tail
Album
  margin : Number
Sets the margin between the child display objects
Album
  mouseChildren : Boolean
[override] Redirect mouseChidren setting to the belt
Album
 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
  rotation : Number
[override] [write-only] Synchronize the drag angle with the album's rotation
Album
  rotationX : Number
[override] [write-only] Synchronize the drag angle with the album's rotation
Album
  rotationY : Number
[override] [write-only] Synchronize the drag angle with the album's rotation
Album
  snapOffset : Number
The offset from the album's origin to snap the belt to.
Album
  snapping : Boolean
A flag indicating the snap animation of the objects into place
Album
 Inheritedsound : String
TouchContainer
 Inheritedstate : Dictionary
TouchContainer
 InheritedstateId : *
Returns the current state id.
TouchContainer
 InheritedtoBitmap : Boolean
TouchContainer
  width : Number
[override] Sets the width of the container and associated mask
Album
 InheritedwidthPercent : Number
sets the width of the container
TouchContainer
Protected Properties
 PropertyDefined By
 InheritedcmlGestureList : Object
TouchContainer
Public Methods
 MethodDefined By
  
Constructor
Album
 Inherited
TouchContainer
 Inherited
method searches the child and adds to the list
TouchContainer
  
addChild(child:DisplayObject):DisplayObject
[override] Reroutes the addition of children from the album to the album's belt and sets the dimesions of the container based on the greatest width and height of the child dimensions.
Album
  
addChildAt(child:DisplayObject, index:int):DisplayObject
[override] Reroutes the addition of children from the album to the album's belt and sets the dimesions of the container based on the greatest width and height of the child dimensions.
Album
  
applyLayout(value:* = null):void
[override] The album element is intended for a ListLayout only.
Album
 Inherited
childToList(id:String, child:*):void
child appended to the childlist
TouchContainer
  
clear():void
Removes belt children and resets initial album states
Album
 Inherited
clone():*
Clone method
TouchContainer
  
dispose():void
[override] Destructor
Album
 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
Album
 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
  
next(tween:Boolean = true):void
Snap to the next item on the belt
Album
  
objectAtSnapPoint(point:int):*
Returns the object at the current stap point
Album
 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
  
previous(tween:Boolean = true):void
Snap to the previous item on the belt
Album
 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
Reset to initial state
Album
 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
  
snapTo(num:Number, tween:Boolean = true):void
Snap to a specific child index
Album
 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
  
updateState(album:Album):void
Intended to synchronize this album with another's state when album linking through the AlbumViewer.
Album
Protected Methods
 MethodDefined By
  
enableDrag(enable:Boolean = true):void
Enables/disables drag gesture
Album
  
flickSnap(e:GWGestureEvent):void
Snap to next or previous depending on flick direction
Album
  
inBounds(e:*):void
Enables the drag if the touch is inside or moves inside the album
Album
  
outOfBounds(e:*):void
Disables the drag if the touch moves outside of the album
Album
  
scrollH(e:GWGestureEvent):void
Drag the belt horizontally within the boundaries.
Album
  
scrollV(e:GWGestureEvent):void
Drag the belt vertically within the boundaries.
Album
Property Detail
applyMaskproperty
applyMask:Boolean

Flag indicating whether the contents are masked

The default value is true.


Implementation
    public function get applyMask():Boolean
    public function set applyMask(value:Boolean):void
backgroundAlphaproperty 
backgroundAlpha:Number

The alpha of the ablum's background


Implementation
    public function get backgroundAlpha():Number
    public function set backgroundAlpha(value:Number):void
backgroundColorproperty 
backgroundColor:uint

The color of the album's background


Implementation
    public function get backgroundColor():uint
    public function set backgroundColor(value:uint):void
beltproperty 
belt:TouchContainer  [read-only]

The primary container and interactive object


Implementation
    public function get belt():TouchContainer
centerContentproperty 
centerContent:Boolean

Flag indicating the album items should be centered horizontally and vertically

The default value is true.


Implementation
    public function get centerContent():Boolean
    public function set centerContent(value:Boolean):void
clusterBubblingproperty 
clusterBubbling:Boolean  [write-only] [override]

Redirect clusterBubbling setting to the belt


Implementation
    public function set clusterBubbling(value:Boolean):void
currentIndexproperty 
currentIndex:Number  [read-only]

Returns the index of the current snap point


Implementation
    public function get currentIndex():Number
currentObjectproperty 
currentObject:*  [read-only]

Returns the current object


Implementation
    public function get currentObject():*
dragAngleproperty 
dragAngle:Number

Intended to account for the rotation of the parent object to apply to drag transformations. This value does NOT set the rotation of the AlbumElement. The rotation must be set through the rotation attribute(s).


Implementation
    public function get dragAngle():Number
    public function set dragAngle(value:Number):void
dragGestureproperty 
dragGesture:String

Specifies the GML drag gesture of the belt (e.g. n-drag, 2-finger-drag, etc.).

The default value is n-drag-inertia.


Implementation
    public function get dragGesture():String
    public function set dragGesture(value:String):void
flickGestureproperty 
flickGesture:String

Specifies the GML flick gesture (e.g. n-flick, etc.) to execute next a previous calls based on flick direction.

The default value is n-flick.


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

Sets the height of the container and associated mask


Implementation
    public function get height():Number
    public function set height(value:Number):void
horizontalproperty 
horizontal:Boolean

Flag indicating the scroll axis

The default value is true.


Implementation
    public function get horizontal():Boolean
    public function set horizontal(value:Boolean):void
layoutproperty 
layout:*[override]

The album element is intended for a ListLayout only. The layout axis can be set by the "horizontal" attribute and the spacing can be adjusted through the "margin" attribute.


Implementation
    public function get layout():*
    public function set layout(value:any):void
loopproperty 
loop:Boolean

A flag instructing the album to continuously cycle through the objects opposed to stopping at the beginning or end. The album must have more than one child to set this flag.


Implementation
    public function get loop():Boolean
    public function set loop(value:Boolean):void
loopQueueproperty 
loopQueue:Array  [read-only]

The queue storing the order of children in the loop from head to tail


Implementation
    public function get loopQueue():Array
marginproperty 
margin:Number

Sets the margin between the child display objects

The default value is 1.


Implementation
    public function get margin():Number
    public function set margin(value:Number):void
mouseChildrenproperty 
mouseChildren:Boolean[override]

Redirect mouseChidren setting to the belt


Implementation
    public function get mouseChildren():Boolean
    public function set mouseChildren(value:Boolean):void
rotationproperty 
rotation:Number  [write-only] [override]

Synchronize the drag angle with the album's rotation


Implementation
    public function set rotation(value:Number):void
rotationXproperty 
rotationX:Number  [write-only] [override]

Synchronize the drag angle with the album's rotation


Implementation
    public function set rotationX(value:Number):void
rotationYproperty 
rotationY:Number  [write-only] [override]

Synchronize the drag angle with the album's rotation


Implementation
    public function set rotationY(value:Number):void
snapOffsetproperty 
snapOffset:Number

The offset from the album's origin to snap the belt to.

The default value is 0.


Implementation
    public function get snapOffset():Number
    public function set snapOffset(value:Number):void
snappingproperty 
snapping:Boolean

A flag indicating the snap animation of the objects into place


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

Sets the width of the container and associated mask


Implementation
    public function get width():Number
    public function set width(value:Number):void
Constructor Detail
Album()Constructor
public function Album()

Constructor

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

Reroutes the addition of children from the album to the album's belt and sets the dimesions of the container based on the greatest width and height of the child dimensions. If clusterBubbling is enabled, the children are wrapped in a TouchSprite to enable interactivity.

Parameters

child:DisplayObject

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

Reroutes the addition of children from the album to the album's belt and sets the dimesions of the container based on the greatest width and height of the child dimensions. If clusterBubbling is enabled, the children are wrapped in a TouchSprite to enable interactivity.

Parameters

child:DisplayObject
 
index:int

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

The album element is intended for a ListLayout only. The layout axis can be set by the "horizontal" attribute and the spacing can be adjusted through the "margin" attribute.

Parameters

value:* (default = null)

clear()method 
public function clear():void

Removes belt children and resets initial album states

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

Destructor

enableDrag()method 
protected function enableDrag(enable:Boolean = true):void

Enables/disables drag gesture

Parameters

enable:Boolean (default = true) — true to enable false otherwise

flickSnap()method 
protected function flickSnap(e:GWGestureEvent):void

Snap to next or previous depending on flick direction

Parameters

e:GWGestureEvent

inBounds()method 
protected function inBounds(e:*):void

Enables the drag if the touch is inside or moves inside the album

Parameters

e:*

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

Initialization function

next()method 
public function next(tween:Boolean = true):void

Snap to the next item on the belt

Parameters

tween:Boolean (default = true) — tween to next item

objectAtSnapPoint()method 
public function objectAtSnapPoint(point:int):*

Returns the object at the current stap point

Parameters

point:int

Returns
*
outOfBounds()method 
protected function outOfBounds(e:*):void

Disables the drag if the touch moves outside of the album

Parameters

e:*

previous()method 
public function previous(tween:Boolean = true):void

Snap to the previous item on the belt

Parameters

tween:Boolean (default = true) — tween to previous item

reset()method 
public function reset():void

Reset to initial state

scrollH()method 
protected function scrollH(e:GWGestureEvent):void

Drag the belt horizontally within the boundaries. If boundaries are exceeded and the belt is not being touched, the drag is disabled and the belt snaps into place.

Parameters

e:GWGestureEvent — the drag event

scrollV()method 
protected function scrollV(e:GWGestureEvent):void

Drag the belt vertically within the boundaries. If boundaries are exceeded and the belt is not being touched, the drag is disabled and the belt snaps into place.

Parameters

e:GWGestureEvent — the drag event

snapTo()method 
public function snapTo(num:Number, tween:Boolean = true):void

Snap to a specific child index

Parameters

num:Number — child index
 
tween:Boolean (default = true) — tween on snap

updateState()method 
public function updateState(album:Album):void

Intended to synchronize this album with another's state when album linking through the AlbumViewer.

Parameters

album:Album — the album to synch to