Message timing problem (was: Re: Can I alter the frame rate of an animated GIF by script?)

Dar Scott dsc at swcp.com
Thu May 13 13:38:06 EDT 2004


On Thursday, May 13, 2004, at 10:45 AM, Graham Samuel wrote:

> I dimly see that I may somehow have activated more than one instance 
> of my showNextFrame handler in some strange way - this is the only way 
> I can imagine the pendingMessages getting closer together than 0.15 
> seconds; but I still badly need suggestions of what I can have done 
> wrong, and if I have called the handler more frequently than my 
> required interval, how I could program the handler to reject these 
> additional calls.

This is usually the problem.

One brute force method is to see if there is the same message in 
pendingMessages() before the send.  Sarah likes this one.

Another is to use a script local variable for the message id.  I use 
empty to mean none.  Thus, if it is not empty, then there is a message 
pending.

However, it might be good to look at why this is happening.  It might 
be that you are not reliably shutting down the mechanism.

If you have a little time, you might want to go through the primer on 
"message mechanics" at my site:

      http://www.swcp.com/dsc/revstacks.html

Dar Scott

****************************************
     Dar Scott Consulting
     http://www.swcp.com/dsc/
     Programming Services
     (Put "revbuddy" in the subject of off-list mail.)
****************************************



More information about the use-livecode mailing list