An Image Display Object can display an animated GIF. By default, the image won’t animate, but if you enable the Animation option it will animate over and over right in the form.

You may want to turn the animation on and off while the form is in use. If you add this code to the image object, the object animation will start and stop each time the object is clicked.

local id,running
id = info("clickedobjectid")
running =
changeobject id,

This little program starts by using the info(“clickedobjectid”) function to find out the id number for the object that was clicked. Then it uses the objectinfo( function to find out whether the animation is currently running or not. Finally, the program uses the changeobject statement to turn the animation on or off. If running was 0, it becomes 1, if it was 1, it becomes 0.

Here is what the code looks like installed in the object.

With this code installed, simply clicking on the image will start the animation (or stop it if it was already going).

See Also


10.0NewNew in this version.