Move and Resize

Malte Brill revolution at derbrill.de
Tue Jul 21 08:54:42 EDT 2009


Hi Dan,

this is a situation where animationEngine is your friend. That said,  
here is a very cheesy version with the on board methods.

The move command seems to get confused by the size change. Very  
cheesy, but you might tweak it to look nicer. Your best bet would be  
to set up a timer, that constantly sets the loc of the object, or let  
AE help you.


FWIW, here is the script:

A stack, 1 button, 2 grcs.

Button script:

on mouseUp
    set the height of grc 1 to 10
    set the width of grc 1 to 10
    set the botright of grc 1 to the botright of this cd
    set the height of grc 2 to 10
    set the width of grc 2 to 10
    set the botLeft of grc 2 to the botleft of this cd
    lock moves
    move grc 1 to 0,0 in 4 seconds without waiting
    move grc 2 to the loc of this cd in 3 seconds without waiting
    unlock moves
    grow
end mouseUp

on grow
    local tOldLoc
    if the long ID of grc 1 is among the lines of the movingControls  
then
       set the height of grc 1 to the height of grc 1 +1
       set the width of grc 1 to the width of grc 1 + 1
    end if
    if the long ID of grc 2 is among the lines of the movingControls  
then
       set the height of grc 2 to the height of grc 1 +4
       set the width of grc 2 to the width of grc 1 + 4
    end if
    -- and so on
    if the movingControls is not empty then
       send "grow" to me in 50 millisecs
    else
       repeat for each line theLine in the pendingMessages
          if "grow" is in theLine then cancel item 1 of theLine
       end repeat
    end if
end grow

Cheers,

Malte



More information about the use-livecode mailing list