PDA

View Full Version : Gif animation


Vitch
03-28-2007, 08:49 AM
Hello,

I'm try to include gif animation in a resource tag.
I can see the gif image but the animation don't start.

With play() action it's same.

example of code :
<simplelayout spacing="5"/>
<resource name="myresource" src="res/test.gif"/>
<button onclick="me.stop()"> Stop </button>
<button onclick="me.play()"> Play </button>
<view id="me" resource="myresource"/>


Laszlo support gif animation ? Or just swf ?

Thanks

madtux666
01-04-2008, 04:38 AM
Hi,

I have similar problem and I don't want to open new topic.

I tried your code, it is still not working.


<canvas>
<simplelayout spacing="5"/>
<resource name="myresource" src="resources/rotatingclock-fast.gif"/>

<button onclick="me.stop()"> Stop </button>
<button onclick="me.play()"> Play </button>

<view id="me" resource="myresource">
<handler name="onplay">
Debug.write('handled play event');
</handler>

<handler name="onstop">
Debug.write('handled stop event');
</handler>
</view>

</canvas>


What I noticed:
1) When image loads, you can click "play" button and proper message appears in Debugger window.

2) Then if you try click "stop" button also message will appear.

3) If you will try to click "stop" button without playing resource firstly, nothing will happen.


I am not sure if my gif file is proper, but I suppose it is correct - n browser I can see nice animation. However in OL image is static.


Has somebody any clues what i should to do to archive animated gif in OL?



Regards,
madtux

spoco2
01-14-2008, 03:00 PM
Laszlo does not support gif animations.

You can either include a swf animated file, or include the frames of the gif as separate frames within the one resource. (see the Lzx reference on how to do this).

Gostak Sakai
04-21-2009, 07:48 AM
There is a program gif2swf that can be found at: http://www.swftools.org

It is an open source program licensed under the GPL. It is a command line tool that will, among other things, convert an animated .gif file to a .swf file. It is available for both Linux, and Windows. I made the Windows version run under wine. There are also other conversions to .swf that presents intriguing possiblities.

What I found was that even though I specified a ten frames per second rate in the animation, and when I opened the .swf file directly in a browser it appeared to play at the correct rate, when I included it in a reference in Open Laszlo, it appeared to play at a much more rapid rate. Here is the reference statement.

<view id="flames" x="220" y="123" resource="images/bb_slw.swf" />

where images/bb_slw.swf is the path to the .swf file.

I am new to Open Laszlo, so I don't know if there is an attribute I am missing to control the playback speed and will not feel offended if someone calls me clueless and provides the obvious solution.

The good part is that it does allow me to put the .swf file anywhere on the canvas I wish.

An example of using an animated .swf image converted from a .gif animation can be found here:
http://www.iserv.net/~gporos/about.htm