use-revolution Digest, Vol 18, Issue 18

Cubist at aol.com Cubist at aol.com
Sat Mar 5 14:50:15 EST 2005


In a message dated 3/5/05 8:47:37 AM, use-revolution-request at lists.runrev.com 
writes:

>From jhurley at infostations.com  Sat Mar  5 11:57:53 2005
>Return-Path: <jhurley at infostations.com>
>Delivered-To: use-revolution at lists.runrev.com
>Received: from mail-relay.infostations.net (mail-relay.infostations.net
>   [69.19.152.5])  by mail.runrev.com (Postfix) with ESMTP id 7463B93007A
>   for <use-revolution at lists.runrev.com>;
>   Sat,  5 Mar 2005 11:57:53 -0500 (EST)
>Received: from seriyu.infostations.net (seriyu.infostations.net [71.4.40.35])
>   by mail-relay.infostations.net (Postfix) with ESMTP id 97E379F813
>   for <use-revolution at lists.runrev.com>;
>   Sat,  5 Mar 2005 08:44:05 -0800 (PST)
>Received: from host-66-81-136-137.rev.o1.com ([66.81.136.137])
>   by seriyu.infostations.net with esmtp (Exim 4.41 #1)
>   id 1D7cNv-0003aB-JS
>   for <use-revolution at lists.runrev.com>; Sat, 05 Mar 2005 08:44:12 -0800
>Mime-Version: 1.0
>Message-Id: <p06200704be4f88c10942@[66.81.136.137]>
>In-Reply-To: <20050305121147.F307593024B at mail.runrev.com>
>References: <20050305121147.F307593024B at mail.runrev.com>
>Date: Sat, 5 Mar 2005 08:44:42 -0800
>To: use-revolution at lists.runrev.com
>From: Jim Hurley <jhurley at infostations.com>
>Content-Type: text/plain; charset="us-ascii" ; format="flowed"
>Subject: Waiting for a handler to finish
>X-BeenThere: use-revolution at lists.runrev.com
>X-Mailman-Version: 2.1.1
>Precedence: list
>Reply-To: How to use Revolution <use-revolution at lists.runrev.com>
>List-Id: How to use Revolution <use-revolution.lists.runrev.com>
>List-Unsubscribe: <http://lists.runrev.com/mailman/listinfo/use-revolution>,
>   <mailto:use-revolution-request at lists.runrev.com?subject=unsubscribe>
>List-Archive: <http://lists.runrev.com/pipermail/use-revolution>
>List-Post: <mailto:use-revolution at lists.runrev.com>
>List-Help: <mailto:use-revolution-request at lists.runrev.com?subject=help>
>List-Subscribe: <http://lists.runrev.com/mailman/listinfo/use-revolution>,
>   <mailto:use-revolution-request at lists.runrev.com?subject=subscribe>
>
>I'm having problems with messages.
>
>I want to have an oval graphic fade out to 0 width and height, 
>relocate to a new position and then fade in with diamMax width and 
>height at the new location.
>
>And I want all this to happen while another graphic is moving on the 
>screen. For this reason, all loops are executed with "send" messages 
>in xx time.
>
>I have tried the following:
>
>local diamMax
>
>on mouseUp
>
>   send "mouseUP" to grc "myGraphic"
>
>   --The above command starts "myGraphic" in motion.
>   --That motion is executed with {"send ..... in 10 millisec" and
>   --is suppose to continue while the rest of this script is running.
>
>   put the width of me  into diamMax
>
>   --I want the following doFadeOut to complete execution before 
>"doFadeIn" starts.
>   doFadeOut diamMax
>
>   --The following wait doesn't do what I want.
>   --It halts everything since the message is received at the
>   --first execution of doFadeOut.
>   wait until "doFadeOut" is not in the pendingMessages --What do I 
>need to do here?
>   set the loc of me to 200,200
>   doFadeIn 0
>end mouseUP
>
>on doFadeOut r
>   set the width of me to r
>   set the height of me to r
>   if r =0 then exit doFadeOut
>   send "doFadeOut r-1" to me in 1 tick
>end doFadeOut
>
>on doFadeIn r
>   set the width of me to r
>   set the height of me to r
>   if r = diamMax then exit doFadeIn
>   send "doFadeIn r+1" to me in 1 tick
>end doFadeIn
>
>I guess I could insert a wait diamMax ticks (plus something for good 
>measure). But there must be a way of detecting when doFadOut has 
>finished and then moving on.
   One thing you might consider is using a custom property; set the 
ItzInvisible of the stack to false when the fading starts, and set it to true when the 
fading is done.
   Another thing you might try is moving your "doFadeIn 0" statement to the 
"doFadeOut" handler, like so:

on doFadeOut r
   set the width of me to r
   set the height of me to r
   if r =0 then
     doFadeIn 0
   else
     send "doFadeOut r-1" to me in 1 tick
  end if
end doFadeOut

   You shouldn't need to explicitly exit "doFadeOut"; the way this is set up, 
it simply won't send "doFadeOut" when R = 0, which means the "send"-loop 
*will* finish at that point.

   Hope this helps...


More information about the use-livecode mailing list