Button Hilites and Move Command

Trevor DeVore trevor at mangomultimedia.com
Fri Jul 26 08:10:01 EDT 2002


Bill,

For the animation part look at using the send command.  Rather than animating in a repeat loop you would have a handler that would check to see if the object is at it's final spot yet.  If not then the object is repositioned and then sends a message to itself with new coordinates in a certain amount of time.  It may look something like this:

on animateMe newX, newY
    if newX <= myFinalXPosition and newY <= myFinalYPosition then
        set the loc of control "myObject" to newX, newY
        send animateMe newX + 10, newY + 10 in 100 milliseconds
    end if
end animateMe

I have found that the send command creates really smooth animations and allows you to call other commands during the process.

Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com


>Greetings:
>
>Second, almost all of my programs have an animated opening sequence that can
>last as long as 15 seconds. Kids seem to enjoy it but teachers and parents
>would rather bypass it and get right to the main menu. In the Director
>version I can test for a control keypdown and respond to it accordingly. I'm
>using the "move" command in Revolution and it appears to lock out events
>preventing me from testing for a control keydown. I've tried the alternative
>of moving objects in the old fashioned way using a repeat loop and changing
>the objects loc through each cycle. While this allows me to look for
>keyboard events it slows the animation down considerably. My question, is
>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
>



More information about the Use-livecode mailing list