Performance Issues With "Move" Command

Klaus Major k_major at os.surf2000.de
Thu Sep 19 06:28:00 EDT 2002


Hi Jim,

> Hi folks,
>
> Thanks for the helpful responses to my "Looping Over Groups" thread.  
> I have one more question and then I think I'm all set for awhile . . . 
> I'm having a very hard time getting the "move" command to perform 
> adequately.  Is this common?  Specifically, here's what I've tried:
>
> I have a simple red circle image (an "Import as Control" jpg).  This 
> moves easily and well:
>
>    move image "o01" to 200,200 in 2 seconds
>
> Creating three such images and moving them all sequentially also works 
> well:
>
>    move image "o01" to 200,200 in 2 seconds
>    move image "o02" to 200,200 in 2 seconds
>    move image "o03" to 200,200 in 2 seconds
>
> But when I try to move them simultaneously things kinda fall apart:
>
>    set the lockMoves to true
>    move image "o01" to 200,200 in 2 seconds
>    move image "o02" to 200,200 in 2 seconds
>    move image "o03" to 200,200 in 2 seconds
>    set the lockMoves to false
>
> It takes a few seconds for anything to happen at all.  Then the first 
> image flickers from its current position to 200,200 without traversing 
> the space in-between (no animation).  Then the second, and then the 
> third do the same thing.  The don't move, they skip.  And they don't 
> do so simultanously as I'd expect.  Any advice on how to get 
> simultaneous motion to perform?  I'm running on a PIII 500Mhz.
>
> BTW, Quicktime or the Animation Manager probably won't work for me 
> (although I'm not positive) as I ultimately want to let the user 
> click-and-drag these images to various points to create their own 
> animation paths.
>
> Thanks!
>
> Jim

the magic word in this case is not "please" but "without waiting" :-)

Just add these 2 words and you will be happy...

...
    set the lockMoves to true
    move image "o01" to 200,200 in 2 seconds without waiting
    move image "o02" to 200,200 in 2 seconds without waiting
    move image "o03" to 200,200 in 2 seconds without waiting
    set the lockMoves to false
...

If you leave them out, the engine tries to perform the first 
"move"-command
before executing the next line of the script (see example below)...

So the engine is questioning itself "To move or not to move..."...
and gets a hiccup ;-)

Try this example:
   move image "o01" to 200,200 in 2 seconds
   beep

It will only beep after the move has been done unless
you add "without waiting". Then it will beep immediately.

Hope that helps.


Regards

Klaus Major
k_major at os.surf2000.de




More information about the use-livecode mailing list