Packagetwaver.controls
Classpublic class GifImage
InheritanceGifImage Inheritance mx.core.UIComponent

This class defines a GIF image resource in an UIComponent. With this class you can display an animated GIF in Flex UI.

Here is an example to define a GIF image resource:

	 //define a embed GIF image resource.
	 [Embed(source="images/image.gif", mimeType="application/octet-stream")]
	 public static const myGif:Class;
	 
	 //register this resource into TWaver Flex.
	 Utils.registerImageByClass("myGif", GifImage, true, null, [ps, twaver.Consts.SHAPE_CIRCLE]);
	 
	 //use this resource in TWaver data.
	 var node:Node = new Node();
	 node.image = "myGif";
	 box.add(node);
	 



Public Properties
 PropertyDefined By
  color : Object
Get the render color of this GIF image.
GifImage
  running : Boolean
[read-only] Check whether the animation is running.
GifImage
  shape : String
Get the image shape.
GifImage
Public Methods
 MethodDefined By
  
GifImage(source:Object, shape:String, autoPlay:Boolean = true)
Constructor.
GifImage
  
start():void
Call this start play GIF image animation.
GifImage
  
stop():void
Call this to stop playing GIF image animation.
GifImage
Protected Methods
 MethodDefined By
  
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
[override]
GifImage
Property Detail
colorproperty
color:Object

Get the render color of this GIF image.


Implementation
    public function get color():Object
    public function set color(value:Object):void
runningproperty 
running:Boolean  [read-only]

Check whether the animation is running.


Implementation
    public function get running():Boolean
shapeproperty 
shape:String

Get the image shape.


Implementation
    public function get shape():String
    public function set shape(value:String):void
Constructor Detail
GifImage()Constructor
public function GifImage(source:Object, shape:String, autoPlay:Boolean = true)

Constructor.

Parameters
source:Object — can be embedded image resource or loaded remotely ByteArray. use Class name if it is embedded image resource. use new Object(){name="imageName", data=Loader.byte} if it is loaded remotely ByteArray
 
shape:String (default = NaN) — shape of GIF image. This value can be:
  • Consts.SHAPE_RECTANGLE
  • Consts.SHAPE_OVAL
  • Consts.SHAPE_ROUNDRECT
  • Consts.SHAPE_STAR
  • Consts.SHAPE_TRIANGLE
  • Consts.SHAPE_CIRCLE
  • Consts.SHAPE_HEXAGON
  • Consts.SHAPE_PENTAGON
  • Consts.SHAPE_DIAMOND

Default value is Consts.SHAPE_RECTANGLE

 
autoPlay:Boolean (default = true) — whether play this GIF animation at once when show it up.
Method Detail
start()method
public function start():void

Call this start play GIF image animation.

stop()method 
public function stop():void

Call this to stop playing GIF image animation.

updateDisplayList()method 
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

Parameters

unscaledWidth:Number
 
unscaledHeight:Number