Recently, debdoot das wrote:

> How do I play a gif animation that has say 4 frames and then execute a script.
> I want all processes to wait till the animation is over.

You can use a repeating send message to test the currentFrame of the
animation.  Something like this (untested):

on myHandler
  set the uAllowRun of me to false
  # (your scripts here)
  # PLAY THE GIF
  set the repeatCount of image myGIF to 1
  testFrame
  wait until the uAllowRun of me is true
  # (more scripts here)
end myHandler

on testFrame
  if the currentFrame of image myGIF = the frameCount of image myGIF then
    set the uAllowRun of me to true
    exit testFrame
  end if
  send "testFrame" to me in 20 milliseconds
end testFrame


Note: If your animation takes a long time to play, you will basically lock
up your machine until the animation is done, due to the "wait" command.  If
possible, it might be better to break up your scripts and trigger the
portions following the animation via a sent message.


Regards,

Scott Rossi
Creative Director

Tactile Media, Multimedia & Design
Email: [EMAIL PROTECTED]
Web: www.tactilemedia.com

Reply via email to