Packageorg.gif.encoder
Classpublic class GIFEncoder



Public Properties
 PropertyDefined by
  stream : ByteArray
[read-only] retrieves the GIF stream
GIFEncoder
Public Methods
 MethodDefined by
  
addFrame(im:BitmapData):Boolean
The addFrame method takes an incoming BitmapData object to create each frames
GIFEncoder
  
finish():Boolean
Adds final trailer to the GIF stream, if you don't call the finish method the GIF stream will not be valid.
GIFEncoder
  
setDelay(ms:int):void
Sets the delay time between each frame, or changes it for subsequent frames (applies to last frame added) int delay time in milliseconds
GIFEncoder
  
setDispose(code:int):void
Sets the GIF frame disposal code for the last added frame and any subsequent frames.
GIFEncoder
  
setFrameRate(fps:Number):void
Sets frame rate in frames per second.
GIFEncoder
  
setQuality(quality:int):void
Sets quality of color quantization (conversion of images to the maximum 256 colors allowed by the GIF specification).
GIFEncoder
  
setRepeat(iter:int):void
Sets the number of times the set of GIF frames should be played.
GIFEncoder
  
setTransparent(c:Number):void
Sets the transparent color for the last added frame and any subsequent frames.
GIFEncoder
  
start():Boolean
Initiates GIF file creation on the given stream.
GIFEncoder
Property detail
streamproperty
stream:ByteArray  [read-only]

retrieves the GIF stream

Implementation
    public function get stream():ByteArray
Method detail
addFrame()method
public function addFrame(im:BitmapData):Boolean

The addFrame method takes an incoming BitmapData object to create each frames

Parameters
im:BitmapData — BitmapData object to be treated as a GIF's frame

Returns
Boolean
finish()method 
public function finish():Boolean

Adds final trailer to the GIF stream, if you don't call the finish method the GIF stream will not be valid.

Returns
Boolean
setDelay()method 
public function setDelay(ms:int):void

Sets the delay time between each frame, or changes it for subsequent frames (applies to last frame added) int delay time in milliseconds

Parameters
ms:int
setDispose()method 
public function setDispose(code:int):void

Sets the GIF frame disposal code for the last added frame and any subsequent frames. Default is 0 if no transparent color has been set, otherwise 2.

Parameters
code:int — int disposal code.
setFrameRate()method 
public function setFrameRate(fps:Number):void

Sets frame rate in frames per second. Equivalent to setDelay(1000/fps).

Parameters
fps:Number — float frame rate (frames per second)
setQuality()method 
public function setQuality(quality:int):void

Sets quality of color quantization (conversion of images to the maximum 256 colors allowed by the GIF specification). Lower values (minimum = 1) produce better colors, but slow processing significantly. 10 is the default, and produces good color mapping at reasonable speeds. Values greater than 20 do not yield significant improvements in speed.

Parameters
quality:int — int greater than 0.
setRepeat()method 
public function setRepeat(iter:int):void

Sets the number of times the set of GIF frames should be played. Default is 1; 0 means play indefinitely. Must be invoked before the first image is added.

Parameters
iter:int — int number of iterations.
setTransparent()method 
public function setTransparent(c:Number):void

Sets the transparent color for the last added frame and any subsequent frames. Since all colors are subject to modification in the quantization process, the color in the final palette for each frame closest to the given color becomes the transparent color for that frame. May be set to null to indicate no transparent color.

Parameters
c:Number — Color to be treated as transparent on display.
start()method 
public function start():Boolean

Initiates GIF file creation on the given stream.

Returns
Boolean — false if initial write failed.