is there a way...

Dar Scott dsc at swcp.com
Thu Apr 24 13:05:10 EDT 2014


I like Paul’s idea.  This is the way I would do it,  This approach was suggested by Robert, also.

A few tips:

Look at the ‘cancel’ command, and ‘pendingMessages’ function and be aware of what they can do.  

When checking out your code, look at the pending messages flying by with the message box and make sure what you see makes sense.

Avoid creating a cascading rain of messages.  Use some sort of lockout to avoid starting the process several times.

Test going to the next card during the process.

You need a way to clear pending messages because of the bug in testing when fading is done that cause messages to go on forever.  Look at the message box.  


If you have trouble, you can look at this old stack I made long ago called “A primer on message mechanics”.  You can find it on this page:

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

I have no idea if that even still works.  

Dar


On Apr 24, 2014, at 9:00 AM, Paul Dupuis <paul at researchware.com> wrote:

> On 4/24/2014 10:46 AM, larry at significantplanet.org wrote:
>> I am putting up an overlay (image) over a field that I display for 1 second and then, using a repeat statement and blendlevel, fade the image until it becomes invisible again.
>> 
>> The problem is that I'm using the wait command to do this and I can't do anything else in the program for those 2 seconds.  I have a vague recollection that I could use pending messages or something, but I cannot remember how to do that.
>> 
>> If you know how, please help.
>> 
> basic approach is: "send message in x seconds", so you do something like:
> 
> on displayImage
>  -- put code to display image in place of this comment
>  send "fadeImage" to me in 1 second
> end displayImage
> 
> on fadeImage
> -- put code to fade the image 1 step towards invisibility in place of
> this comment
>  if (not FullyInvisible) then send "fadeImage" to me in 10 milliseconds
> end fadeImage
> 
> where "FullyInvisible" is a check for whether you have fully faded the
> image or not (true in you have, false if not)
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list