AS3 GIF Player Class 0.3 by Thibault Imbert

After working with the GIF format in ActionScript 3 since a few days, I wanted to be able to load animated GIF's into the player which is not possible for the moment. If you load a GIF file with the flash.display.Loader class you will only get the first frame of the animation.

With this new GIFPlayer class, everything is handled, I have added some methods as you would call on a traditional flash.display.MovieClip

To load an animated GIF you would do :

// we create the GIFPlayer, it plays automatically by default
var myGIFPlayer:GIFPlayer = new GIFPlayer();
// we show it
addChild ( myGIFPlayer );
// we load a gif file
myGIFPlayer.load ( new URLRequest ("animation.gif") );
// you can also load any valid GIF stream (ByteArray) with the loadBytes method (version 0.2)
myGIFPlayer.loadBytes ( gifStream );
// listen for the IOErrorEvent.IO_ERROR event, dispatched when the GIF fails to load
myGIFPlayer.addEventListener ( IOErrorEvent.IO_ERROR, onIOError );
// listen for the GIFPlayerEvent.COMPLETE event, dispatched when GIF is loaded
myGIFPlayer.addEventListener ( GIFPlayerEvent.COMPLETE, onCompleteGIFLoad );
// listen for the FrameEvent.FRAME_RENDERED event, dispatched when a GIF frame is rendered on screen
myGIFPlayer.addEventListener ( FrameEvent.FRAME_RENDERED, onFrameRendered );
// listen for the FileTypeEvent.INVALID event, dispatched when an invalid file is loaded
myGIFPlayer.addEventListener ( FileTypeEvent.INVALID, onInvalidFileLoaded );
// get total frames
myGIFPlayer.totalFrames;
// standard methods
myGIFPlayer.play();
myGIFPlayer.stop();
myGIFPlayer.gotoAndStop(3);
myGIFPlayer.gotoAndPlay(3);

Please test it, and let me know if you got good results. Please don't load huge GIF files, some optimization will be done for this one in the following days.

Online Demo :

A Flash animation should have appeared here, but it seems that your browser has an older version of the Flash Player or it is not installed at all. Please, install the last release of the Flash Player now, then reload this page.

Projects using GIFPlayer Class :

Piterwilson did a funny experiment with this and the GIFAnimation Encoder class.

Sources and documentation available at http://code.google.com/p/as3gif/

Comments (133)

  1. Harry wrote::

    Very nice. Will be very interesting for TagLoops. Expecting the code

    Friday, June 1, 2007 at 9:50 am #
  2. bigop wrote::

    j’obtient cette erreur quand j’essaye d’uploader un gif:

    Error #2044: IOErrorEvent non pris en charge : text=Error #2038: Erreur d’E/S de fichier.
    at decoder_fla::MainTimeline/decoder_fla::frame1()

    en tout cas bravo !
    on en revait en 1999! :)

    Friday, June 1, 2007 at 11:46 am #
  3. Thibault Imbert wrote::

    salut bigop,

    peux tu m’envoyer le GIF que tu as tenté d’uploader sur thibault {at} bytearray.org

    merci ;)

    Friday, June 1, 2007 at 11:52 am #
  4. Tek wrote::

    bigop > I was dreaming on that too in 1999 ;)

    Thibault> Really nothing … but why not disable all the button while uploading/loading the file ?

    Friday, June 1, 2007 at 7:20 pm #
  5. Thibault Imbert wrote::

    Tek > Yes, I will post a new version with new features, I’ll do that at the same time ;)

    Sunday, June 3, 2007 at 11:10 pm #
  6. Iain wrote::

    My GIF uploaded & displayed ok, but for some reason when I pressed the play button it went to the next frame and stopped rather than playing straight through. To make it animate I had to keep hammering the button! Is this a bug?

    Great work btw!

    Tuesday, June 12, 2007 at 1:52 pm #
  7. Iain wrote::

    Also, another GIF I loaded had some areas go transparent – perhaps inter-frame compression doesn’t work properly?

    Tuesday, June 12, 2007 at 1:56 pm #
  8. Thibault Imbert wrote::

    Hi lain,

    concerning the GIF which was not playing, it is a bug I have fixed in the online version and downloadable sources, can you try downloading the sources again and tell me ?

    can you give me a link to that gif ? tks :)
    concerning the transparent areas, I have noticed that issue and I will fix that :)

    cheers ;)

    Tuesday, June 12, 2007 at 2:05 pm #
  9. Han Sanghun wrote::

    Hi, Thibault.
    I expierenced the transparent area problem, too. And I found that this is caused by GIFs those are frame differenc optimized.
    You can get the GIF from the following link.
    http://www.webreference.com/dev/gifanim/index.html

    best regards

    Monday, June 18, 2007 at 11:24 am #
  10. Thibault Imbert wrote::

    Hi Han,

    great, thank you very much for the link !

    cheers ;)

    Monday, June 18, 2007 at 3:48 pm #
  11. Iain wrote::

    this one has some transparent areas:
    http://www.jasoncoleman.com/Media/Images/hellsyeah.gif

    good luck fixing this one – animated gifs rock! (probably should be supported natively right?)

    Thursday, June 21, 2007 at 6:35 pm #
  12. Thibault Imbert wrote::

    hi lain,

    thanks for the link !

    currently working on another project, but will get back to it for sure :)

    I heard that they were talking about adding it in the player but Macromedia didn’t have the rights to add it. :(

    Thursday, June 21, 2007 at 8:52 pm #
  13. shark wrote::

    i need it

    Friday, June 22, 2007 at 10:20 am #
  14. Piterwilson wrote::

    Just a quick note on an issue that happened to me, its a bit silly but it should be noted in case it happens to someone else:

    For the gif playback to be accurate the movie must have a framerate that is as fast as the animated gif.

    My animated gif wasnt playing at the right speed, then in noticed i had my movie at 5fps (douh!) when the gif needed 12fps. The sample source available here, has 12fps which might not be enough if your animated gif runs faster than that.

    Keep up the excellent work.

    Monday, July 2, 2007 at 4:35 pm #
  15. Gill tas wrote::

    Hi

    I cannot download the zip file. Link is broken.

    Thanks again !

    Monday, July 9, 2007 at 11:54 am #
  16. Thibault Imbert wrote::

    Hi Gill,

    sorry link has been fixed ;)

    cheers

    ;)

    Monday, July 9, 2007 at 2:30 pm #
  17. Sergei wrote::

    Hi Thibault,
    sorry for my bad English.
    Your code is very useful for me. Thanks a lot!
    I found a bug. As I know every frame in GIF has only part of image. You should merge it with the first frame. The code is:
    GIFPlayer.as:
    private function onTime ( pEvt:TimerEvent ) :void
    {
    ……
    //It was
    //bOutput.bitmapData = aFrames[ iIndex ];
    //Should replace
    bOutput.bitmapData = aFrames[ 0 ];
    bOutput.bitmapData.draw(aFrames[ iIndex ]);
    ………..
    }

    Tuesday, July 10, 2007 at 1:56 pm #
  18. Thibault Imbert wrote::

    Hi Sergei,

    Nice one ! This is nice,  it fixes the interframe problem ;)

    Thanks a lot ! :D

    Wednesday, July 11, 2007 at 2:48 am #
  19. Sergei wrote::

    Hi again Thibault,
    my previous code was not so good :))
    I updated it.
    This one works fine:
    private function onTime ( pEvt:TimerEvent ) :void
    {
    ……
    //It was
    //bOutput.bitmapData = aFrames[ iIndex ];
    //Should replace
    if (iIndex == 0)
    bOutput.bitmapData = (aFrames[ 0 ] as BitmapData).clone();

    bOutput.bitmapData.draw(aFrames[ iIndex ]);
    ………..
    }

    Good luck!

    Wednesday, July 11, 2007 at 5:50 pm #
  20. Thibault Imbert wrote::

    I updated source code :)

    Thank you Sergei ;)

    Thursday, July 12, 2007 at 10:02 pm #
  21. noone wrote::

    If you got Flash, why on earth would you need and animated gif?

    Tuesday, July 17, 2007 at 5:55 pm #
  22. Thibault Imbert wrote::

    Hi noone,

    just an old skool geeky experiment ;)

    Some applications could take advantage of it :)

    cheers

    Tuesday, July 17, 2007 at 6:33 pm #
  23. percy wrote::

    le estoy muy agradecido por estos avances

    Wednesday, July 18, 2007 at 2:02 pm #
  24. Shinobu wrote::

    After ripping my hair of a thousand times trying to solve this interframe issue I seem to have noticed why its not behaving correctly. it seems the Frame Object for each frame didn’t include the Dispose value individually. Each frame of an animated gif have there own disposal values. so after cramming a new value into that class along with changes to the imagereader I no longer have transparency and disappearing issues! Simply put you need to retrieve and store each disposal value into there respective frames. being able to display animated gifs correctly is an asset for Galleries and thumbnails!

    Sunday, August 5, 2007 at 11:55 am #
  25. Thibault Imbert wrote::

    Hi Shinobu,

    Concerning the interframe issue, a fix has been added on the 07/13/07 where the dispose value is tested to draw each frame.

    regards,

    Tuesday, August 7, 2007 at 12:04 am #
  26. JL wrote::

    Hi,

    I’m a Flex newbie and I get this error when trying to add the GIFPlayer to an existing component:

    ——–
    TypeError: Error #1034: Type Coercion failed: cannot convert org.gif.player::GIFPlayer@4b5fb51 to mx.core.IUIComponent.
    ——–

    I’m trying to add the GIFPlayer to a VBox using
    ——–
    myVBox.addChild(myGIFPlayer);
    ——–

    Any idea? Is it possible to use GIFPlayer within Flex?

    Thanks!

    JL

    Thursday, August 9, 2007 at 8:39 pm #
  27. Thibault Imbert wrote::

    Hi JL,

    In Flex, you can’t directly add a Sprite as a component child. You must add the GIFPlayer into a UIComponent and add it to your flex component.

    It would give something like this :

    var myGIFComponent:UIComponent = new UIComponent();

    var myGIFPlayer:GIFPlayer = new GIFPlayer();

    myGIFComponent.addChild( myGIFPlayer );

    myVBox.addChild( myGIFComponent );

    let me know ;)

    regards,

    Thursday, August 9, 2007 at 11:45 pm #
  28. JL wrote::

    Whouhou! Works really well.

    Thanks a lot!

    Friday, August 10, 2007 at 1:34 am #
  29. VIA wrote::

    Thibault you are atta-boy!

    That`s very nice.

    Thursday, August 23, 2007 at 8:13 pm #
  30. Olga wrote::

    Thank U so much, very usefull thing!!!!

    Monday, September 10, 2007 at 3:31 pm #
  31. JL wrote::

    Hi,

    Would it be possible to use this script on an embedded image? I use Flex.

    Thanks for the help!

    JL

    Tuesday, September 11, 2007 at 1:49 am #
  32. mattjpoole wrote::

    The google code http trunk seems to be empty…

    Thursday, September 13, 2007 at 5:29 pm #
  33. tltmusashi@mail.ru wrote::

    What about MouseEvent?

    Wednesday, October 24, 2007 at 5:37 pm #
  34. Thibault Imbert wrote::

    mattjpoole >> Thanks, I will update it :)

    tltmusashi >> MouseEvent ?

    Monday, October 29, 2007 at 1:10 am #
  35. tltmusashi wrote::

    yes, MouseEvents!

    var myGIFLoader:GIFLoader = new GIFLoader();

    myGIFLoader.AddEventListener(MouseEvent.MOUSE_OVER, onMouseOver);

    function onMouseOver(hEvent:MouseEvent):void{
    trace(‘MouseOver’+hEvent.currentTarget.name);
    }

    istn work!

    Friday, November 9, 2007 at 2:58 pm #
  36. JL wrote::

    Hi Thibault,

    Thanks again for that code! Can you just tell me if what I ask is possible? To use gifPlayer with an embedded image?

    I use your code within Flex and would like to animate a gif that is embedded.

    Thank you!

    Thursday, November 15, 2007 at 11:58 pm #
  37. Thibault Imbert wrote::

    Hi JL,

    I did an update for you, I have added a loadBytes method to the GIFPlayer class.

    Just pass the GIF ByteArray that you embedded to the loadBytes method and it should run :)

    You can download the update here :

    http://www.bytearray.org/wp-content/projects/gifplayer/beta/GIFPlayer0.2.zip

    let me know :)

    kind regards,

    Thibault

    Friday, November 16, 2007 at 12:28 am #
  38. JL wrote::

    Hi Thibault,

    Thanks for this new method! Unfortunately I’m not able to get a ByteArray from my embedded gif.

    The only way I found to get a ByteArray from an image is:

    ———-
    var testBM:Bitmap = testImg.content as Bitmap;
    var myByte:ByteArray = new JPEGEncoder().encode(testBM.bitmapData);
    ———-

    But of course this will generate a jpg, not a gif.

    Can you help me with that? How can I get my ByteArray from my gif?

    Another really small thing:

    Could you add a “:void” return type to those functions:
    - GIFDecoder.readNetscapeExt
    - GIFDecoder.setPixels

    I get a warning about that. I know it’s not really important but I prefere to have no warning at all!

    Thank you again for your work, it’s really appreciated!

    JL

    Friday, November 16, 2007 at 6:18 pm #
  39. Thibault Imbert wrote::

    Hi JL,

    to embed your GIF as a ByteArray you can use the [Embed] tag in Flex :

    [Embed(source="mygif.gif", mimeType="application/octet-stream")]
    private var gifStream:Class;

    then you can create an instance of it :

    var gifBytes:ByteArray = new gifStream();

    gifPlayer.loadBytes (gifBytes);

    I have also updated the GIFDecoder class, so that you don’t have any more warnings :)

    http://www.bytearray.org/wp-content/projects/gifplayer/beta/GIFPlayer0.2.zip

    Saturday, November 17, 2007 at 1:40 pm #
  40. Thibault Imbert wrote::

    Hi tltmusashi,

    To get MouseEvent’s you can add the GIFPlayer instance to an InteractiveObject :

    var holder:Sprite = new Sprite();

    holder.addChild ( myGIFPlayer );

    addChild ( holder );

    Then, you will be able to interact with the loaded GIF :)

    kind regards,

    Thibault

    Saturday, November 17, 2007 at 1:43 pm #
  41. JL wrote::

    Woouhou! It works really well.

    Thanks a lot Thibault! :-)

    Monday, November 19, 2007 at 4:51 pm #
  42. Thibault Imbert wrote::

    Hi JL,

    Happy it works ;)

    regards,

    Thibault

    Monday, November 19, 2007 at 4:54 pm #
  43. Thibault Imbert wrote::

    Hi tltmusashi,

    You can add the GIFPlayer object as a Sprite child and then you get interactivity events with the GIF :)

    kind regards,

    Thibault

    Sunday, December 2, 2007 at 6:04 pm #
  44. Alex C wrote::

    Hey.

    I was really wondering. Is there anyway to modify the height&width of the loaded gif? the function would really be useful.

    Thanks!

    Tuesday, December 4, 2007 at 12:29 pm #
  45. Hi Piter,
    I’m wondering, have you used the GIFPlayer to show the instant preview animation in your experiment, or did you built something yourself?

    thanks,
    Mugur.

    Saturday, December 8, 2007 at 8:51 pm #
  46. diego wrote::

    Hi,
    I’m able to add the animated gif to a UI component in flex, but then the animated gif appears choppy in the resulting swf(i think this has something to do with frame rates, but am not entirely sure). I’ve put up the swf, mxml, and gif files and would appreciate very much any help. I’m using GIFPlayer v0.2

    The files are located here:
    http://www.diegoolano.com/files/animatedgif/Display_bg.gif
    http://www.diegoolano.com/files/animatedgif/animatedgif.mxml
    http://www.diegoolano.com/files/animatedgif/animatedgif.swf

    regards,
    Diego

    Friday, December 14, 2007 at 6:02 pm #
  47. jim wrote::

    Whouhou! Works really well.
    Thanks a lot!

    Friday, January 11, 2008 at 11:18 am #
  48. villalvilla wrote::

    Hi all!
    I’ve used this code and it’s really cool! I use it to allow people in my project watching animated gifs streaming them with the red5 server. The resulting app is really cool! But i had to extend/change a little bit your code to allow your GIFPlayer class to be passed a ByteArray through a property to load the image via streaming option with AMF3 from red5. I was going to submit that idea to the google’s project, but the wiki is not working right now. I hope you read this post and think about implementing that thing in the next release, it works like a charm for me! If you need some help just tell me!
    This project is amazing!
    regards

    Thursday, April 24, 2008 at 7:56 am #
  49. Thibault Imbert wrote::

    Hi villalvilla,

    Thanks for your kind comment !

    Check comment N°39, I added such a feature in the release 0.2.

    Let me know :)

    kind regards,

    Thibault

    Thursday, April 24, 2008 at 2:33 pm #
  50. Siroko wrote::

    Hi Thibault,

    First of all, congratulations for that cake, it´s amazing! but i have a question , is there some option to change width and height of the loaded object ?¿

    Im trying modify the height value of the display object where the gif is added but the object disappears…

    I saw at PiterWilson webCam Gif generator he has a fullScreen feature for the gif secuences then it´s possible make that.

    Thanks Thibault.

    Monday, May 19, 2008 at 6:29 pm #
  51. jose wrote::

    Estoy usando “org.gif.player.GIFPlayer” (la version 0.2) en “Flex” y tengo un problema: Necesito redimensionar la imagen; No quiero que el gif resultante tenga su tamaño original.
    ¿Hay alguna posibilidad de hacer eso?

    Thursday, May 29, 2008 at 7:41 am #
  52. Question W wrote::

    HI,

    I am trying to make this thing work. I am new to Flex and am getting an easy error (well what I hope is easy to fix).

    Can anyone help?

    error:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

    Code:

    import org.gif.player.GIFPlayer;
    import org.gif.errors.FileTypeError;
    import org.gif.events.FileTypeEvent;
    import org.gif.events.FrameEvent;
    import org.gif.events.GIFPlayerEvent;
    import org.gif.events.TimeoutEvent;

    var myGIFPlayer:GIFPlayer = new GIFPlayer();

    public function MainMenuWeatherButtonClick():void
    {
    this.cursorManager.setBusyCursor();

    viewstackMain.selectedIndex = 1;

    vboxWeatherRadar.addChild( myGIFPlayer );

    myGIFPlayer.load(new URLRequest(“http://sirocco.accuweather.com/nx_mosaic_640x480_public/sir/inmaSIRWI_.gif”));

    myGIFPlayer.play();

    this.cursorManager.removeBusyCursor();
    }

    thanks!!!

    Monday, June 9, 2008 at 10:56 am #
  53. Thibault Imbert wrote::

    Hi Question W,

    I tested your GIF image, and it runs fine. There might be an error somewhere else.

    Can you try to remove the lines concerning the viewstackMain and cursorManager ?

    let me know :)

    kind regards,

    Thibault

    Monday, June 9, 2008 at 6:33 pm #
  54. grboy21thcen@sina.co wrote::

    can’t set gif’s size,if refresh IE

    Tuesday, June 10, 2008 at 12:55 pm #
  55. Question W wrote::

    Yeah I will right now. Wow I didn’t think I would get a reply any time soon. Thanks!!!

    Wednesday, June 11, 2008 at 11:34 am #
  56. Question W wrote::

    As soon as I change it to this…

    I get a bunch of errors.

    4
    1120: Access of undefined property myGIFPlayer.

    1
    1120: Access of undefined property vboxWeatherRadar.

    and 2

    1084: var ‘myGIFPlayer’ will be scoped to the default namespace: main: internal. It will not be visible outside of this package.

    So I don’t know what is up with the thing….. any ideas? thanks in advance

    Wednesday, June 11, 2008 at 11:49 am #
  57. Question W wrote::
    Wednesday, June 11, 2008 at 11:50 am #
  58. Question W wrote::

    apparently its not showing the code because of script blocks….

    lets try this

    Wednesday, June 11, 2008 at 11:51 am #
  59. Question W wrote::

    well that is a no but basically I commented out the function declaration the brackets and the requested items.

    Wednesday, June 11, 2008 at 11:52 am #
  60. Question W wrote::

    Do you have a sample project that you could post to the google code site? All I want to do is use your cool code to make a gif work in a flex project. Thanks, W

    Wednesday, June 11, 2008 at 11:58 am #
  61. Jloa wrote::

    Hi, Thibault Imbert. The width/height property return 0, event after COMPLETE event dispatch. The GIFPlayerEvent has the ‘rect’, but it’s useless.
    I’ve edited your GIFPlayer class (you should have done that).
    All u needed 2 do is just to create a public var

    public var rect:Rectangle;

    And after in the readStream method to do so:

    rect = aFrames[0].bitmapData.rect;
    dispatchEvent (new GIFPlayerEvent( GIFPlayerEvent.COMPLETE , aFrames[0].bitmapData.rect));

    U’d probably ask why did i do that. The answer is simple – 2 make thingz more useful.

    Ex:

    import org.gif.player.GIFPlayer;
    import org.gif.events.GIFPlayerEvent;

    var myGIFPlayer:GIFPlayer = new GIFPlayer();
    myGIFPlayer.addEventListener(GIFPlayerEvent.COMPLETE, onCompleteGIFLoad);
    myGIFPlayer.load(new URLRequest(“diego.gif”));
    addChild(myGIFPlayer);

    function onCompleteGIFLoad(event:GIFPlayerEvent):void
    {
    updatePos();
    }

    function updatePos():void
    {
    trace(“Now we can retrive the width/height in order to place/replace the player”, myGIFPlayer.rect);
    }

    Thursday, September 18, 2008 at 8:53 pm #
  62. Jloa wrote::

    cheers ^_^

    Thursday, September 18, 2008 at 8:54 pm #
  63. Smash wrote::

    Hello…
    I have a problem with this gif…

    http://smash.interfree.it/original.gif

    When load some colors do not appear…why?

    Friday, September 19, 2008 at 12:51 pm #
  64. Jloa wrote::

    Smash >> some gif files exported via Photoshop are not frame-by-frame based, they are frame-by-frame but with ‘shared’ static background (see the photoshop preferences at the quality ‘web-based’ etc)
    Gif player renders properly only those, which aren’t ‘web-based’, but i may be wrong.

    Friday, September 19, 2008 at 2:09 pm #
  65. spotatoes wrote::

    var gif:GIFPlayer = new GIFPlayer();
    addChild(gif);
    gif.load(new URLRequest(“http://www.mb5u.com/uploads/jc/0835030.gif”));

    gif.play();

    //output
    Error: Nothing to play
    at org.gif.player::GIFPlayer/play()
    at GIFPlayer_fla::MainTimeline/frame1()

    Monday, November 24, 2008 at 11:15 am #
  66. Thibault Imbert wrote::

    Hi spotatoes,

    Do not call the play method, just call the load method which will play the GIF automatically.

    You can use methods like play, stop, etc once the GIFPlayerEvent.COMPLETE is fired.

    let me know,

    best,

    Thibault

    Monday, November 24, 2008 at 1:53 pm #
  67. gino8080 wrote::

    How to save an animated gif with the new fileReference of player 10?

    Wednesday, December 10, 2008 at 6:39 pm #
  68. Thibault Imbert wrote::

    Hi gino,

    You can use the GIF Encoder class I did :

    http://www.bytearray.org/?p=93

    And save the GIF bytes on your disk and just play it :)

    Wednesday, December 10, 2008 at 10:32 pm #
  69. David wrote::

    Hi. Thanks for doing the work of this interesting project. I just tried out the version 0.4 gif player and it worked fine on some GIF87a content, but failed to render some GIF89a content. I think the problem might be in this code (or my use of it) of the GIFPlayer.as in the update function, specifically
    switch ( gifDecoder.disposeValue )
    Here, the 89a files such as I have tried return a disposeValue of 0, which is not handled. If I try instead the same handling that you have case of disposeValue of 1, for the 0 case, it works fine for the GIF89a case. Happy to provide more details if you want.

    Friday, December 12, 2008 at 5:26 am #
  70. DIGUU wrote::

    I hope the GIFPlayer can load gif or jpg

    How I do

    Saturday, December 13, 2008 at 6:12 pm #
  71. villalvilla wrote::

    Hi Tibault!
    Congratulations for your great work!
    I’ve been using this library for more or less 1 year and it worked wonderfull, but i found some gifs that doesn’t work with your library.
    I’ve tried them and when your library tries to load them, only a white rectangle appears!
    you can probe them from this links:
    http://www.amezbros.com/1.gif
    http://www.amezbros.com/2.gif
    http://www.amezbros.com/3.gif

    I’ve also uploaded this files to your online application and they don’t work. It’s strange, because they are only one frame long…

    regards,
    villalvilla

    Wednesday, December 17, 2008 at 6:59 pm #
  72. Aurélien wrote::

    Encore un beau travail que ce player de gif.
    Juste un petit problème , lors du chargement du gif , cela fait saccader mon animation flash en cours …

    Sunday, January 11, 2009 at 1:08 am #
  73. Thibault Imbert wrote::

    Salut Aurélien,

    C’est un étrange bug, pourrai tu m’envoyer un fla ou un projet Flex d’exemple ?

    Cool que tu apprécies ce petit player de GIF :)

    Thibault

    Sunday, January 11, 2009 at 1:19 am #
  74. Erki Esken wrote::

    Here’s a tip how to convert these GIFs with cropped frames in them to a “normal” GIF file.

    In Fireworks CS4, open one of such .gif files, then select File > Image Preview. Make sure you have Animated GIF type and then select Animation tab and deselect “Crop each frame”. OK.

    After this open History panel, select and save the Export Settings history step as a custom command.

    Now you can usse File > Batch Process, select all your gif files, select and add the newly made command and after that add Export (Settings: Use Settings from Each File) and run the batch.

    Now you should have all your previously flickering gifs running OK in this excellent GIFPlayer class!

    Tuesday, February 10, 2009 at 12:33 pm #
  75. Thibault Imbert wrote::

    Hi Erki,

    Thanks for that great information !

    Thibault

    Tuesday, February 10, 2009 at 12:57 pm #
  76. ashish wrote::

    Hey..excellent work.
    It is a great help. thanks

    Wednesday, May 6, 2009 at 6:22 pm #
  77. Hello Thibault!
    Merci pour ta classe!
    I need to animate a GIF that I embedded and the ByteArray method you posted doesn’t work. I have an invalid cast error (can’t create a bytearray from an embedded GIF). If I create a new Bitmap class from the embedded Class, and then use the getBytes method, the loadBytes() doesn’t read nothing.

    I’ll post my code.

    [Embed( source="../assets/ajax-loader.gif", mimeType="application/octet-stream")]
    private var loader_gif:Class;

    var load_bmp:BitmapAsset = new loader_gif() as BitmapAsset;
    var bytes:ByteArray = load_bmp.bitmapData.getPixels(new Rectangle(0, 0, load_bmp.width, load_bmp.height))

    try
    {
    _loader_player.loadBytes(bytes);
    }
    catch (e:Error)
    {
    Dumper.error(“GIF error: ” + e.message);
    }

    Monday, May 18, 2009 at 1:53 pm #
  78. I have to specify that if I do the same without embedding the image (using the load(:URLRequest) method) it works, so the problem is in how I get the bytes out of the embedded image.

    Monday, May 18, 2009 at 1:58 pm #
  79. Thibault Imbert wrote::

    Hi Luca,

    Please try :

    [Embed( source="../assets/ajax-loader.gif", mimeType="application/octet-stream")]
    private var loader_gif:Class;

    var gifBytes:ByteArray = new loader_gif() as ByteArray;

    try
    {
    _loader_player.loadBytes(gifBytes);
    }
    catch (e:Error)
    {
    Dumper.error(”GIF error: ” + e.message);
    }

    let me know,

    Thibault

    Monday, May 18, 2009 at 2:02 pm #
  80. Marcus wrote::

    I need to dynamically load a some image assets. The thing is, I dont know the type before its loaded. Is there a known way to test the file-type before trying to load the asset. It could be a jpeg, swf, png or animated gif.

    It would be nice to be able to switch between Loader and GIFPlayer. Thanks in advance

    Tuesday, May 19, 2009 at 4:50 pm #
  81. Patrick Leffas wrote::

    Thibault,

    I have v0.3 of your (wonderful) GIFPlayer, and have a couple questions for you:

    1) Is it possible to resize a GIF after it has been loaded? I saw a couple other posts about this, and the mention of a solution, but whenever I set myGIFPlayer.height (or .width), the GIF is not displayed on the stage during runtime.

    2) Is there a property in plae to dynamically set the playback rate of the GIF? I see how to change the value of delay in the GIFDecoder class, but don’t see a property in the GIFPlayer class (unless I’m missing something).

    Thanks.

    Wednesday, June 24, 2009 at 12:33 am #
  82. Joe Reger wrote::

    Thanks for the great work on this package. I’ve got the same question as Patrick Leffas… can I resize a GIFPlayer object? Simply setting myGIFPlayer.width disappears the image. I’m now playing with the GIFFrames array to see if I can resize each one individually. Any insight appreciated. I’ve got an app that pulls from an existing library of gifs that’re too big for the user interface.

    Monday, July 13, 2009 at 3:28 pm #
  83. Thibault Imbert wrote::

    Hi Joe and Patrick,

    To resize the GIFPlayer object, just wait for the first FrameEvent.FRAME_RENDERED event to be dispatched, and resize it at this time, it should work smoothly.

    Concerning delay time setting between each frame, good idea ! I will add this in a forthcoming update.

    best,

    Thibault

    Monday, July 13, 2009 at 4:21 pm #
  84. Fried Khan wrote::

    Hello,

    i got a question about AS3.

    Is it possible to export a .gif from a pure AS3 coded .fla ?

    I only get a blank GIF. Would it be possible to use your code for such a conversion?

    cheers Fried

    Wednesday, September 2, 2009 at 3:15 pm #
  85. Girish wrote::

    as per our company norms i am not able to download the source code that u given in this blog. can u suggest me any other alternative. thanks in advance:)

    Wednesday, October 21, 2009 at 9:52 am #
  86. Thibault Imbert wrote::

    Hi Girish,

    You can download the sources on this page : http://code.google.com/p/as3gif/downloads/list

    And get the latest sources here :

    http://as3gif.googlecode.com/files/GIFPlayer%200.4.zip

    let me know,

    best,

    Thibault

    Wednesday, October 21, 2009 at 12:08 pm #
  87. JustinFact wrote::

    I love this. Thanks for another great project Thibault

    Wednesday, November 18, 2009 at 11:00 pm #
  88. colorhook wrote::

    Hi, Thibault Imbert.
    Thanks you for this nice project, and I think I found a bug of it.
    If I call the method ‘gotoAndStop’, then I can’t get the correct value of property ‘currentFrame’.

    So, I think the private property ‘iIndex’ should update to a new value in the function ‘gotoAndStop’
    iInc = iIndex = int(int(pFrame)-1);

    Wednesday, November 25, 2009 at 11:16 am #
  89. Thibault Imbert wrote::

    Hi colorhook,

    Yes, nice bug! I also added a modification in the gotoAndPlay method. I will post an update today :)

    Thanks!

    Thibault

    Wednesday, November 25, 2009 at 12:02 pm #
  90. Thibault Imbert wrote::

    Hi colorhook,

    It is fixed in 0.5 with some other minor improvements :)

    http://code.google.com/p/as3gif/

    Thanks ;)

    Wednesday, November 25, 2009 at 12:36 pm #
  91. sdt wrote::

    It just a good idea!

    Friday, November 27, 2009 at 10:28 am #
  92. Hi Thibault,

    A kill(); method to clear instances and memory maybe’ll be interesting.

    Wednesday, December 2, 2009 at 10:25 pm #
  93. Thibault Imbert wrote::

    Hi André,

    Yes, the next release will integrate a dispose() method.

    Thanks!

    Thibault

    Thursday, December 3, 2009 at 3:17 am #
  94. Thibault Imbert wrote::

    Hi André,

    I added a dispose() method in release 0.6 :)

    let me know,

    Thibault

    Thursday, December 3, 2009 at 7:44 am #
  95. 1int wrote::

    Hi!
    I’m having a problem with some GIF files. It seems new frames are drawn but the old ones are not erased. The problem appears only on certain files. Here’s one of them: http://depositfiles.com/files/qjrb3rcp8

    It looks like some kind of bug, hope you fix it!
    Cheers!

    Friday, December 4, 2009 at 6:45 pm #
  96. Charlie wrote::

    i dont like this. i usually load bitmaps with bulkloader on higher level and pass the bitmaps to my classes. i cant modify the code to make it work.

    isnt there a function like?
    myGif.decodeBitmap(bitmap:Bitmap)
    {
    var gif = bitmap.decode(whatever);
    addChild(gif);
    }

    i dont need the loading file event. its too much for a gif to have a loader in there.

    when im calling myGif.width and myGif.height this also makes problems. i dont like -.-

    Monday, January 11, 2010 at 3:15 pm #
  97. walv wrote::

    Hi guys.

    I’ve written a UI component wrapper for this GIFPlayer:

    package
    {
    import flash.events.IOErrorEvent;
    import flash.utils.ByteArray;

    import mx.core.UIComponent;

    import org.bytearray.gif.events.FileTypeEvent;
    import org.bytearray.gif.events.GIFPlayerEvent;
    import org.bytearray.gif.player.GIFPlayer;

    public class AnimatedGIF extends UIComponent
    {
    private var myGIFPlayer:GIFPlayer;

    private var _gifStream:Class;

    /**
    * Constructor
    */
    public function AnimatedGIF()
    {
    super();
    myGIFPlayer = new GIFPlayer();
    //add as a child
    addChild ( myGIFPlayer );
    //loads stream
    loadGifStream();
    // listen for the IOErrorEvent.IO_ERROR event, dispatched when the GIF fails to load
    myGIFPlayer.addEventListener ( IOErrorEvent.IO_ERROR, handleError );
    // listen for the GIFPlayerEvent.COMPLETE event, dispatched when GIF is loaded
    myGIFPlayer.addEventListener ( GIFPlayerEvent.COMPLETE, handleCompleted );
    // listen for the FileTypeEvent.INVALID event, dispatched when an invalid file is loaded
    myGIFPlayer.addEventListener ( FileTypeEvent.INVALID, handleError );
    }

    public function set gifStream(c:Class) : void
    {
    _gifStream = c;
    loadGifStream();
    }

    public function get gifStream() : Class
    {
    return _gifStream;
    }

    /**
    * @private
    */
    private function loadGifStream() : void
    {
    if (_gifStream)
    {
    myGIFPlayer.stop();
    // we load a gif file
    var gifBytes:ByteArray = new _gifStream();
    myGIFPlayer.loadBytes(gifBytes);
    }
    }

    /**
    * @private
    * Handles when the GIF fails to load or an invalid file is loaded
    */
    private function handleError(e:IOErrorEvent) : void
    {
    trace(e.text);
    }

    /**
    * @private
    * Handles the GIF player completed
    */
    private function handleCompleted(e:GIFPlayerEvent) : void
    {
    myGIFPlayer.play();
    }

    /**
    * @private
    */
    override public function set visible(value:Boolean):void
    {
    super.visible = value;
    if (value)
    {
    myGIFPlayer.play();
    }
    else
    {
    myGIFPlayer.stop();
    }
    }

    }
    }

    Now you can easy use animated gifs in mxml:

    [Embed(source="spinner_20x20.gif", mimeType="application/octet-stream")]
    private var gifStream:Class;

    Friday, January 15, 2010 at 3:36 pm #
  98. walv wrote::

    my previous message was truncated…

    Now you can easy use animated gifs in mxml:

    [Embed(source="spinner_20x20.gif", mimeType="application/octet-stream")]
    private var gifStream:Class;

    Saturday, January 16, 2010 at 11:07 am #
  99. walv wrote::

    Oh..looks like this forum ‘kills’ any XML tags.
    About MXML, hope you’ve got main idea.

    Saturday, January 16, 2010 at 11:11 am #
  100. eyleyl wrote::

    Hi,

    excellent work.
    It is a great help. thanks

    I updated it.
    it fix problem.
    (CellRenderer 0 ) ? delay : 100;

    switch ( gifDecoder.disposeValue )
    {
    case 1:
    if ( !iIndex )
    {
    if(bitmapData == null)
    {
    bitmapData = aFrames[ 0 ].bitmapData.clone();
    }
    else
    {
    bitmapData.draw ( aFrames[ 0 ].bitmapData );
    }
    }
    else
    {
    bitmapData.draw ( aFrames[ iIndex ].bitmapData );
    }
    break
    case 2:
    bitmapData = aFrames[ iIndex ].bitmapData;
    break;
    }

    dispatchEvent ( new FrameEvent ( FrameEvent.FRAME_RENDERED, aFrames[ iIndex ] ) );
    }
    Good luck!

    Saturday, January 23, 2010 at 9:21 am #
  101. Louis wrote::

    This package is awesome. player and encoder both works fine in most case. but when I pass a output from encoder to player (i.e. player.loadBytes(encoder.stream), it gives no response. can anyone help?

    Tuesday, January 26, 2010 at 12:35 pm #
  102. zgldh wrote::

    That’s what I need.

    Thursday, January 28, 2010 at 11:37 am #
  103. Tissi wrote::

    Hi Thibault, hello everybody,

    I am not familiar with any program language at all. I am looking for a gif-player, with that the user is only able to start the gif until it reaches its end. During playing the gif the user should not have the option to stop it until the endframe is reached ( so I need a play and a rewind button). Unfortunately I am not able to modify your player. Is there anyone who can do that for me, please?! I want to integrate the player into an HTML document. Is that possible?

    Many thanks in advance

    Tissi

    Friday, February 12, 2010 at 3:20 am #
  104. DocMabuse wrote::

    var _mcLoader:MovieClip = new MovieClip()
    var gifPlayer:GIFPlayer = new GIFPlayer();
    gifPlayer.totalFrames;
    _mcLoader.addChild(loadBalken);
    loadContainer.rawChildren.addChild(_mcLoader);
    gifPlayer.load(new URLRequest(‘img/ajax-loader.gif’));

    listen you cant add an Flash Sprite or Movieclip to an Uicomponent
    You have to take the rawChildren

    Friday, February 19, 2010 at 3:15 pm #
  105. Tom wrote::

    Thanks for your class & help… I’m able to run an animated GIF under flex 3, if not executing a remoteObject call… but when I start my animated GIF, which is supposed to be there to run while my remoteObject call retrieves results from a DB, it “hangs” (maybe see 1st 2 frames) until remoteObject call completes… which is obviously not the intended result… any help here on what to do to keep animation running during remoteObject call would be greatly appreciated!

    Thanks,
    Tom

    Monday, March 8, 2010 at 7:34 am #
  106. bg wrote::

    can any body give me the mxml code for runnig the code of walv

    Tuesday, April 6, 2010 at 3:58 pm #
  107. Scott wrote::

    Hi,

    This gif player is awesome and just what I needed for my project.

    However, I would like to load my GIF and it not play straight away. I tried the gifplayer.stop () when the image is loaded and then using gifplayer.play() to start it.

    However, in doing this, the gif does not display until .play() is called. I am able to stop it once it has played and the gif remains on display.

    Any suggestions how I can solve this would be greatly appreciated.

    Many Thanks

    Scott

    Tuesday, April 13, 2010 at 4:02 pm #
  108. Thibault Imbert wrote::

    Hi Scott,

    I am happy that you like the GIFPlayer ! :)

    Concerning your issue, you can instantiate the GIFPlayer object by passing false for the autoPlay parameter.

    var myGIFPlayer:GIFPlayer = new GIFPlayer(false);

    That would do the trick :)

    let me know,

    best,

    Thibault

    Tuesday, April 13, 2010 at 6:26 pm #
  109. Scott wrote::

    Thibault,

    Thank you for your speedy response :)

    I tried that, and still get the same result. Perhaps it might be something in the rest of my code causing it? Do you think that could affect it?

    I’m fairly new to AS3 and have had subject myself pretty intensivly to it, so my troubleshooting skills aren’t up to much yet.

    Also, I was wondering if it is possible to increase and decrease the speed that the loaded if plays at?

    Many Thanks

    Scott

    Wednesday, April 14, 2010 at 2:31 pm #
  110. Multiple frames? wrote::

    Hi there, first of all i want to say that its an awesome add-on to the flash community

    Unfortunately i have a little problem. A couple of images do not play well, the first frame is good, but the second shows the first and the second, the third shows the first, the second and the third, and so on. Then when its done with the animation it starts over at frame 1 again.. Seems like something is wrong..

    And i must say, it depends on the image =/ which i saved the same way as working ones =/

    example:
    working:http://i4.photobucket.com/albums/y106/tvledden/sprites/th_RoyC51.gif
    notworking: http://i4.photobucket.com/albums/y106/tvledden/sprites/Leah.gif
    notworking:http://s4.photobucket.com/albums/y106/tvledden/sprites/?action=view&current=Sage_Ph.gif&sort=ascending

    Do you know of this problem?

    Friday, April 30, 2010 at 8:25 pm #
  111. Amos wrote::

    I just want to express my gratitude for making and sharing these excellent GIF tools. I’ve never really liked GIFs, but they are an “industry standard” and now they are easy to use in Flex/Flash. Thank you!

    PS: When I get a chance, I plan to attempt an APNG player based on your code. It should be an excellent framework to start from!

    Friday, May 21, 2010 at 3:49 am #
  112. Zap wrote::

    Great work, works very well.

    Has anyone got this working with spark textarea and the InlineGraphicElement class? Or know an easy way to get this to work?

    Thanks.

    Monday, August 2, 2010 at 12:55 pm #
  113. buzzknow wrote::

    Hi, when i try to load animated gif from my PC, its display all framein all motion …

    so like multiple image in once time :(

    regards

    Saturday, August 21, 2010 at 7:44 pm #
  114. pinky wrote::

    hey
    thanku so much for such a nice GIFPlayer(), just wat i require for my project using flex, u saved my day… thanku once again.its wonderful.

    Wednesday, September 15, 2010 at 12:32 pm #
  115. Stu wrote::

    nice stuff
    However, its very slow for larger files.

    I rewrote it a little bit to decode each frame/image asynchronously, which is working ok (just too much cpu usage overall).

    And I was wondering, couldn’t we just use the build in GIF support to decode each frame’s image data separably. Should greatly speed it up, assuming the native decoder ifs faster than this as3 one.

    Friday, September 17, 2010 at 2:10 am #
  116. dany wrote::

    Hi there, first of all i want to say that its an awesome add-on to the flash community

    Unfortunately i have a little problem. A couple of images do not play well, the first frame is good, but the second shows the first and the second, the third shows the first, the second and the third, and so on. Then when its done with the animation it starts over at frame 1 again.. Seems like something is wrong..

    And i must say, it depends on the image =/ which i saved the same way as working ones =/

    example:
    http://i4.photobucket.com/albums/y106/tvledden/sprites/Leah.gif

    Do you know of this problem?

    Tuesday, September 21, 2010 at 4:49 am #
  117. Renaud63 wrote::

    Bonjour Mr Imbert,

    Savez-vous si il est possible d’exporter une simple image en GIF depuis cs4 / as3 ? Je veux dire par là charger une image depuis le serveur (jpg, png, gif…) et en faire une sortie gif. J’ai vu que l’on pouvait utiliser une classe pour le PNG et le JPG…mais le GIF ?
    D’avance merci.
    Cordialement.

    Friday, November 5, 2010 at 9:37 am #
  118. Dream wrote::

    Hi Thibault,Thanks for share so usefull class.

    Could you pls tell me how to decode a gif animations and save each frame to file?

    Thans.

    Tuesday, December 28, 2010 at 8:58 am #
  119. Egbert wrote::

    Hello, i want to use this inside a texflow, but everytime i add a new line the first one dissapears, does anyone have a example of how to use one GIFPlayer multiple times?

    Regards,
    Egbert

    Friday, January 14, 2011 at 3:03 pm #
  120. Casey Pugh wrote::

    Seems like no one posted how to resize the animated gif after it’s loaded. I put up some sample code if you’re interested.

    This code allows you to resize the width and height of an animated GIF loaded in through GIFPlayer.

    It’s hardly been tested, but with the GIFs I’ve used it has worked great.

    https://gist.github.com/1238101

    Friday, September 23, 2011 at 8:48 pm #
  121. I started with this GIF library, but it’s not suitable for displaying user-provided GIFs because it’s far too slow for large GIFs (>500Kb) and doesn’t accurately render certain GIFs because of a bug regarding the frame disposal method.

    I ended up re-writing it from scratch to leverage the Flash Player’s built in GIF decoder. Each frame of the animation is dynamically re-packaged as an individual single-frame GIF file and handed to the Loader class to be decoded by the player asynchronously.

    In my testing, letting the Flash Player handle image decoding improves decoding performance by two orders of magnitude.

    Gif compatibility is also improved because I correctly implemented rendering of the gif dispose property, so all GIF files should play without artifacts.

    Additionally, the playback framerate in my library is more accurate because I snap each frame to be displayed on the correct frame based on the current stage frameRate, and optionally support frame skipping if the stage frameRate is too slow.

    Take a look: https://github.com/Worlize/Flash-Animated-GIF-Library

    Tuesday, March 20, 2012 at 2:45 am #
  122. Luca wrote::

    Grat class, but i want to know, there exist a method to stop the render process? It cause some cpu issues to my swf when the gif is of a great size

    Wednesday, May 2, 2012 at 10:20 am #
  123. Jay Gillmore wrote::

    Keep working, splendid job!

    Friday, June 22, 2012 at 3:45 pm #
  124. lsdev wrote::

    Hello, is there a progress event handler? Also, my whole .swf freezes until the gif is loaded, is there a way around this?

    Friday, June 22, 2012 at 6:38 pm #
  125. 942avril wrote::

    非常棒!很实用!

    Tuesday, July 24, 2012 at 2:55 pm #
  126. Tom wrote::

    Shame that the transparency doesn’t work for every frame.. otherwise a great tool.

    Thanks.

    Thursday, July 26, 2012 at 5:43 pm #
  127. Anthony wrote::

    Brian McKelvey’s decoder is much faster.
    Thanks Brian,and Thibault.

    Monday, September 24, 2012 at 11:41 am #
  128. ganesh wrote::

    HI, can any one suggest how to include this class path in flash develop.

    I don’t want to add it in global class path just for one time use.

    Tuesday, January 15, 2013 at 10:30 am #
  129. anil wrote::

    hi,
    what is wrong this gif in gifPlayer

    http://www.idea-files.com/problemGif/127.gif

    sorry bad english

    Wednesday, January 30, 2013 at 8:47 pm #
  130. Lysle wrote::

    I am also having problems with my gifs being partially transparent past frame 1. I was able to compound the images together, but then bits of frame 1 will appear on the sides of frame 2 and 3.

    I understand that GIFs are optimized by not containing all the data in each frame, but only the data of pixels that have changed. I am attempting to find a way to ‘deoptimize’ them, or as some sources call it ‘coalesce’ each frame. This is not readily apparent in AS3.

    I have many GIF files. If I can find a way to do it via script that I can execute on many GIFs at once and automatically as more GIFs are added to my database, that would be ideal. However at the time I am unable to find even a basic program that coalesces/decompresses/deoptimizes frame 2, 3, etc one at a time.

    Please email me if you have the solution.

    Saturday, March 2, 2013 at 3:33 am #
  131. Lysle wrote::

    Reading more about GIF’s here:
    http://giflib.sourceforge.net/whatsinagif/animation_and_transparency.html

    I am thinking that this class has the 3 disposal methods, but the problem is that disposal method 1 is not working correctly. When new frames have areas of transparency vs areas of no data, the transparency should override previous frames data. Instead, areas of transparency are treated like areas of no data, allowing the previous frames to show up through the transparency.

    Saturday, March 2, 2013 at 4:14 am #
  132. Brian Bedard wrote::

    Thibalt,

    I’m enjoying this project and was trying to integrate it into an existing project that loads all images via Loader instead of URLLoader. Rather than have to load the gifs again using your code, I was trying to get the bytearray from the loader itself. I can see the bytearray works with my code, but it’s invalid for the loadBytes method you’ve created. Any idea how to make Loader work in the same format? Thanks!

    var loaderInfo:LoaderInfo = LoaderInfo( BitmapLibrary.getImageLoaderInfoFromID( this._image_id ) );

    this.myGIFPlayer.loadBytes( loaderInfo.bytes );

    Wednesday, February 5, 2014 at 10:26 pm #
  133. Sodah wrote::

    Large GIF will flash freeze…..

    Monday, April 7, 2014 at 10:19 am #

Trackbacks/Pingbacks (28)

  1. [...] AS3 GIF Player Class 0.1 [...]

     
  2. [...] via: bytearray [...]

     
  3. [...] 上禮拜回老家 再加上週日都在玩電吉他 所以又好幾天沒寫文章了~>0< 今天就來介紹一個滿實用的網站 – ByteArray.org 而這個網站是以ActionScript3.0為主 進行開發一些實驗性的Project 目前的Project有八個 WiiFlash、Raster、MouseGesture、Live JPEG Encoder、PageFlip、 SMTP Mailer、GIF Animation Encoder、GIFPlayer 其中我比較感興趣的是Raster、MouseGesture、Live JPEG Encoder、SMTP Mailer 也就是比較偏向繪圖、影像、網路應用的部分 接著就來簡單介紹一下我個人覺得超猛的滑鼠手勢辨識Project – MouseGesture 不多說~先來玩看看再說拉~ 以下是一些擷取畫面 最左邊是字母跟數字的手勢說明,中間是手勢的圖畫區,右邊顯示滑鼠手勢輸入的文字 還可以輸入空格、點,也可以刪除文字 [...]

     
  4. » FlexͿѻ on Tuesday, December 25, 2007 at 5:10 am

    [...] bytearray.org

     
  5. Another ByteArray & FXC Mix….FXCLoader: Labs@flexcoders on Thursday, January 24, 2008 at 2:32 pm

    [...] created a wrapper around a component build by Thibault Imbert. Because it is an extenstion of the Flex SWFLoader, which allready can load SWF and images, you can [...]

     
  6. タロタローグ ブログ on Thursday, May 1, 2008 at 6:08 pm

    I challenged GIFPlayer. However, it failed. Then, I corrected GIFPlayer….

    現在、Progression Frameworkの実験として、「Flickrから最新写真一覧のRSSを読み込んで、アルバムっぽく表示する」というのを作ってみとるんですわ。でまぁ、RSSやら画像のロード中に表示する…

     
  7. [...] http://www.bytearray.org/?p=95 [...]

     
  8. AS3的GIF播放器及Encoder | 『 闪 界 』 on Thursday, March 19, 2009 at 11:02 am

    [...] 介绍 as3gif下载地址(Google Code) 本文对您有用吗? 何不留下评论继续交流, 或者在您的博客上引用本文继续探讨. 您可以订阅读者对本文的回应或者订阅本博客以在您的阅读器中自动获取更新. [...]

     
  9. [...] fotografa del GIF. Si queremos mostrar un GIF animado, tendremos que usar una librería externa: AS3 GIF Player. Es muy sencillo utilizarlo, pero si ustedes lo piden, podemos repasarlo en un próximo artículo. [...]

     
  10. AnimatedGifLoader – New Flex Component | Doug McCune on Wednesday, June 17, 2009 at 6:09 pm

    [...] alternatives to load animated gifs in Flash/Flex projects. Please see the following links: http://www.bytearray.org/?p=95 [...]

     
  11. Animated Gif Loader Flex component updated | Doug McCune on Wednesday, June 17, 2009 at 6:10 pm

    [...] alternatives to load animated gifs in Flash/Flex projects. Please see the following links: http://www.bytearray.org/?p=95 [...]

     
  12. [...] primer fotograma. Sin embargo, gracias a los buenos oficios de Thibault Imbert tenemos la librería AS3 GIF Player Class, disponible en [...]

     
  13. as3gif tweak to support Flex @ on Wednesday, July 8, 2009 at 3:46 am

    [...] http://www.bytearray.org/?p=95 [...]

     
  14. Useful Flash Libaries and API’s on Tuesday, August 25, 2009 at 6:49 pm

    [...] zips etc ascollada – collada file type as3syndicationlib – xml feeds (rss/atom) GIF Player GIF [...]

     
  15. 有米啦 » AS3的GIF播放器及Encoder[转] on Friday, September 4, 2009 at 9:43 am

    [...] 介绍 [...]

     
  16. 使用AcrionScript加载GIF动画 | Color Hook on Wednesday, November 25, 2009 at 2:39 pm

    [...] Imbert (bytearray.org)有一个使用ActionScript动态加载GIF动画并播放的Project。 这个项目也可以在Google [...]

     
  17. [...] to the GraphicElement class which can contain any kind of DisplayObject and therefore also the GIFPlayer [...]

     
  18. AS3 JPEG Decoder - ByteArray.org on Wednesday, August 11, 2010 at 6:32 pm

    [...] a JPEG decoder in AS3 ? The Flash Player does it natively and supports it, its not like decoding animated GIFs, or BMP, etc. Well, for my part, I needed a JPEG decoding class for AlivePDF in order to make the [...]

     
  19. Flex开源图形组件 on Tuesday, September 7, 2010 at 3:55 pm

    [...] GIF Player Class http://www.bytearray.org/?p=95 GoogleCode: [...]

     
  20. Animated Gifs in Flex 3 — HTMLCoderHelper.com on Sunday, November 14, 2010 at 12:26 pm

    [...] I’ve implemented this example: http://www.bytearray.org/?p=95, but for larger gifs it’s very CPU intensive and causes the UI to [...]

     
  21. AS3 GIF Player | RyanCao's Blog on Thursday, December 2, 2010 at 7:21 am

    [...] 来源网站 AS3 GIF Player 示例 123456789101112131415161718192021222324<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml&quot;                 layout="absolute" minWidth="955" minHeight="600" creationComplete="onInit()">     <mx:Script>         <![CDATA[             import mx.core.UIComponent;                         import org.gif.player.GIFPlayer;                         private var myGIFComponent:UIComponent;             private var myGIFPlayer_web:GIFPlayer;                         private function onInit():void             {                 myGIFComponent =    new UIComponent();                 myGIFPlayer_web =   new GIFPlayer();                 myGIFComponent.addChild( myGIFPlayer_web );                 addChild( myGIFComponent );                 myGIFPlayer_web.load(new URLRequest("assets/11.gif"));             }         ]]>     </mx:Script>     </mx:Application> 浏览:1 次 This entry was posted in ActionScript 3 and tagged GIF Player. Bookmark the permalink. ← parlsey 常见错误 [...]

     
  22. [...] Наконец то! Гиф во флеше [...]

     
  23. [...] Наконец то! Гиф во флеше [...]

     
  24. Flex开源项目 « 能博客 on Thursday, July 28, 2011 at 6:49 am

    [...] GIF Player Class http://www.bytearray.org/?p=95 GoogleCode: [...]

     
  25. Postmortem del juego de Cachicamoconcaspa | El Chigüire Literario on Wednesday, September 21, 2011 at 1:51 am

    [...] primer frame. Así que se hace necesario embeberlo como un archivo binario y reinterpretarlo con GIF Player, una librería que interpreta los bytes en binario para reproducir el GIF animado completo. Lo [...]

     
  26. [...] вопросы на форумах нашёл одно очень замечательное решение, а именно мини библиотека(Open Sourse) которая позволяет [...]

     
  27. アニメgifをFlashで再生(AS3GIF) | 水玉製作所 on Monday, May 14, 2012 at 1:22 am

    [...] と、言っても、ライブラリの作例をちょっと改変しただけなんだけど。 作例がFlashIDE+FlashPlayer9向けなので、FlashDevelop+FlashPlayer10向けに書き換えてみた。要はflaファイルを不要にしたのと、ファイルの読み込みをFileReferenceのload()を使うようにした。 あと、ついでにASDocも作ってみた。 [...]

     
  28. Flash Player 中显示GIF动画 | Limbo-Nova on Wednesday, September 26, 2012 at 12:40 pm

    [...] 在他的Blog里介绍了这个方法,从java GIF encoder [...]