Packagecom.gestureworks.cml.elements
Classpublic class Image
InheritanceImage Inheritance TouchContainer Inheritance com.gestureworks.core.TouchSprite
Subclasses Flickr

The Image class loads and displays an external bitmap file.
 
        
        var img:Image = new Image();
        img.src = "my_image.png";
        img.init();
        addChild(img);
        
     



Public Properties
 PropertyDefined By
  aspectRatio : Number
[read-only] Stores the aspectRatio of the currently loaded image
Image
 InheritedautoShuffle : Boolean
autoshuffles
TouchContainer
  avatar : Boolean
sets the avatar value
Image
  bitmap : Bitmap
Stores a reference to the currently loaded bitmap
Image
  bitmapArray : Array
[read-only] stores images in an array
Image
  bitmapData : BitmapData
Stores a reference to the currently loaded bitmapData
Image
  bitmapDataArray : Array
[read-only] stores bitmap data array
Image
  bitmapDataCache : Boolean
Specifies whether the bitmapData is cached or not
Image
 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
 InheriteddimensionsTo : Object
Sets the dimensions of TouchContainer to given object
TouchContainer
 InheriteddropShadow : Boolean
Sets the drop shadow effect
TouchContainer
  fileData : Bitmap
Image
 Inheritedgroup : String
TouchContainer
  height : Number
[override] Sets width of the display object in pixels
Image
 InheritedheightPercent : Number
sets the height of the container
TouchContainer
 Inheritedid : String
Returns the object's id.
TouchContainer
  img : ImageLoader
Image
  isLoaded : Boolean = false
Image
  landscape : Boolean
[read-only] specifies whether the loaded image is landscape or not
Image
 Inheritedlayout : *
specifies the type of layout
TouchContainer
 InheritedlayoutList : Dictionary
TouchContainer
 InheritedmouseChildren : Boolean
[override] sets the mousechildren value to true or false.
TouchContainer
  normalize : Boolean
specifies whether loaded image is normalised or not
Image
 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
  percentLoaded : Number
Image
  portrait : Boolean
[read-only] specifies whether the loaded image is portrait or not
Image
 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
  resample : Boolean
Specifies whether a loaded image is resampled to the provided width and/or height.
Image
  sizeArray : Array
stores array list size
Image
 Inheritedsound : String
TouchContainer
  src : String
Sets the file source path
Image
 Inheritedstate : Dictionary
TouchContainer
 InheritedstateId : *
Returns the current state id.
TouchContainer
 InheritedtoBitmap : Boolean
TouchContainer
  width : Number
[override] Sets width of the display object in pixels
Image
 InheritedwidthPercent : Number
sets the width of the container
TouchContainer
Protected Properties
 PropertyDefined By
  _bitmapDataArray : Array
Image
 InheritedcmlGestureList : Object
TouchContainer
Public Methods
 MethodDefined By
  
Constructor
Image
 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
  
clone():*
[override] Returns a clone of this Image
Image
  
close():void
Closes the currently open image file
Image
  
dispose():void
[override] Destructor
Image
 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
Image
  
loadComplete(event:Event = null):void
This is called when the image is loaded.
Image
 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
  
open(file:String = null):void
Opens an external image file
Image
 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
  
resize():void
Image
 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
Protected Methods
 MethodDefined By
  
Image
  
onPercentLoad(event:LoaderEvent):void
Image
Property Detail
_bitmapDataArrayproperty
protected var _bitmapDataArray:Array

aspectRatioproperty 
aspectRatio:Number  [read-only]

Stores the aspectRatio of the currently loaded image

The default value is 0.


Implementation
    public function get aspectRatio():Number
avatarproperty 
avatar:Boolean

sets the avatar value

The default value is false.


Implementation
    public function get avatar():Boolean
    public function set avatar(value:Boolean):void
bitmapproperty 
bitmap:Bitmap

Stores a reference to the currently loaded bitmap

The default value is null.


Implementation
    public function get bitmap():Bitmap
    public function set bitmap(value:Bitmap):void
bitmapArrayproperty 
bitmapArray:Array  [read-only]

stores images in an array


Implementation
    public function get bitmapArray():Array
bitmapDataproperty 
bitmapData:BitmapData

Stores a reference to the currently loaded bitmapData

The default value is null.


Implementation
    public function get bitmapData():BitmapData
    public function set bitmapData(value:BitmapData):void
bitmapDataArrayproperty 
bitmapDataArray:Array  [read-only]

stores bitmap data array


Implementation
    public function get bitmapDataArray():Array
bitmapDataCacheproperty 
bitmapDataCache:Boolean

Specifies whether the bitmapData is cached or not

The default value is false.


Implementation
    public function get bitmapDataCache():Boolean
    public function set bitmapDataCache(value:Boolean):void
fileDataproperty 
public var fileData:Bitmap

heightproperty 
height:Number[override]

Sets width of the display object in pixels

The default value is 0.


Implementation
    public function get height():Number
    public function set height(value:Number):void
imgproperty 
public var img:ImageLoader

isLoadedproperty 
public var isLoaded:Boolean = false

landscapeproperty 
landscape:Boolean  [read-only]

specifies whether the loaded image is landscape or not

The default value is false.


Implementation
    public function get landscape():Boolean
normalizeproperty 
normalize:Boolean

specifies whether loaded image is normalised or not

The default value is false.


Implementation
    public function get normalize():Boolean
    public function set normalize(value:Boolean):void
percentLoadedproperty 
public var percentLoaded:Number

portraitproperty 
portrait:Boolean  [read-only]

specifies whether the loaded image is portrait or not

The default value is false.


Implementation
    public function get portrait():Boolean
resampleproperty 
resample:Boolean

Specifies whether a loaded image is resampled to the provided width and/or height. In order for resampling to work, this must be set to true, and a width and/or height must be set prior to calling open.

The default value is false.


Implementation
    public function get resample():Boolean
    public function set resample(value:Boolean):void
sizeArrayproperty 
sizeArray:Array

stores array list size


Implementation
    public function get sizeArray():Array
    public function set sizeArray(value:Array):void
srcproperty 
src:String

Sets the file source path

The default value is null.


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

Sets width of the display object in pixels

The default value is 0.


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

Constructor

Method Detail
bitmapComplete()method
protected function bitmapComplete():void

clone()method 
override public function clone():*

Returns a clone of this Image

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

Closes the currently open image file

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

Destructor

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

Initialisation method

loadComplete()method 
public function loadComplete(event:Event = null):void

This is called when the image is loaded. Do not override this method.

Parameters

event:Event (default = null)

onPercentLoad()method 
protected function onPercentLoad(event:LoaderEvent):void

Parameters

event:LoaderEvent

open()method 
public function open(file:String = null):void

Opens an external image file

Parameters

file:String (default = null)

resize()method 
public function resize():void