I have to admit that I just love animated GIF's, it reminds me the old school days playing the SNES
Recently I found a java GIF encoder and decided to implement it in AS3, ok maybe some people will say it's just unuseful but here it is, I love it !
Everything is encoded through the player. Then you know the story, the GIF stream is sent through AMFPHP to a server to download it, and then save it to your hard disk. Any kind of images can be included in the final GIF, each frame is a flash.display.BitmapData object.
I'll post the sources in a few days, I want to add some more features, stay tuned !
Here is how to generate an animated GIF stream in ActionScript 3 :
// we create the GIF encoder var myGIFEncoder:GIFEncoder = new GIFEncoder(); // we call the start method to start a new GIF file stream myGIFEncoder.start(); // we call the setRepeat method with 0 as parameter so that it loops myGIFEncoder.setRepeat(0); //we specify each frame delay in ms before each addFrame call myGIFEncoder.setDelay ( 100 ); //we add each BitmapData as frames with the addFrame method myGIFEncoder.addFrame( new BitmapData ( 200, 200 ) ); // we finalize the GIF stream by calling the finish method myGIFEncoder.finish(); // then you retrieve the GIF ByteArray with the stream getter var myGIFStream:ByteArray = myGIFEncoder.stream;
Online Demo :
The GIF Encoder looks nice on the Web Flash Festival 2007 screen
This work is licensed under a Creative Commons Attribution 3.0 License.
Sources and documentation available at http://code.google.com/p/as3gif/