Asynchronous GIF decoder written in ActionScript 3


Async GIF decoder

An asynchronous GIF decoder written in ActionScript 3 that lets you play animated GIFs in flash without freezing the UI.

Inspired by Lee Burrows’ Async-Image-Encoders, based on Thibault Imbert’s as3gif.

var gif:GIF = new GIF();
    gif.addEventListener(Event.COMPLETE, function(event:Event):void
    {
        trace("done", gif.totalFrames);
        gif.play();
    });
    gif.addEventListener(IOErrorEvent.IO_ERROR, function(event:Event):void
    {
        trace(event);
    });
    gif.load(new URLRequest("smile.gif"));

addChild(gif);

If you want to play GIFs in your starling based app, you can use GPUGIF class.

Tagged:

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s