Button Hilites and Move Command

Klaus Major klaus.major at metascape.org
Fri Jul 26 08:51:01 EDT 2002

Hi Bill,

> Greetings:
> ...
> there any way to use the "move" command and test for events while it is
> running. Or, does anyone have a better way to approach moving objects 
> on a
> card (without flipping through hundreds of cards) and still test for 
> events?
> Cheers... Bill Lynn
> Simtech Publications
> www.hsj.com

of course Trevor has given an excellent example on how to use
the "send"-command to move things smoothly :-)

But here are some more hints on using the move-command.
Maybe you already know that, but i don't care ;-)

To move several object in sync use this command:

on xxx
     set the lockmoves to true
     ## prevents things from moving
     move button 1 to the points of grc 1 in 3 secs without waiting
     move button 2 to the points of grc 2 in 5 secs without waiting
     move image 1 to the points of grc 5 in 2 secs without waiting
     set the lockmoves to false
     ## now all 3 objects start moving in sync
end xxx

"without waiting" lets the script continue, which would pause otherwise
without this statement.

   move btn 1 to 500,500

would only beep AFTER the button has reached its destination

Now if you want to stop the animation (e.g. to go to another card) you 
script something like this:

on xxx
   repeat for each line i in the movingcontrols
   ## this function provides all the currently moving objects
    stop moving i
   end repeat
   go cd "next card or whatsoever..."
end xxx

Hope this helps...

Have a nice weekend.


Klaus Major
klaus.major at metascape.org

More information about the use-livecode mailing list