Canceling pending messages

Geoff Canyon gcanyon at inspiredlogic.com
Fri Jan 4 13:32:01 EST 2002


At 5:27 AM -0800 1/4/02, Jim Hurley wrote:
>The following script is recommended in the Rev.  web site as preferable to the use of the idle message:
>
>on showPlayerCurrentTime
>put the currentTime of player "My Player" into field "Player Progress"
>send "showPlayerCurrentTime" to me in 500 milliseconds
>end showPlayerCurrentTime
>
>
>In this way, "showPlayerCuttentTime is repeated every  500 milliseconds.
>
>My question is: How would one  stop this cycle? How  does one interrupt the send routine? What part of the "pendingmessages" does one "cancel"?

Just change it to:

on showPlayerCurrentTime
put the currentTime of player "My Player" into field "Player Progress"
send "showPlayerCurrentTime" to me in 500 milliseconds
set the pUpdateProgressMessage of player "My Player" to the result
end showPlayerCurrentTime

Now you should be able to stop the process in any script with this command:

cancel (the pUpdateProgressMessage of player "My Player")

You can also use a global variable -- in fact, I always have. The property idea just occurred to me.

regards,

Geoff




More information about the use-livecode mailing list