Move many buttons all at same time

Malte Brill revolution at derbrill.de
Fri Jan 21 10:50:31 EST 2011


Hi Josep (an all),

Taking up Anthonys suggestion, here is a quick animationEngine version.

create a stack, many buttons

name one of the buttons "doIt"

set the script of btn "doIt" to

on mouseUp pMouseBtnNo
    if "animationEngine" is not among the lines of the stacksInUse then
      answer "This needs AE to run"
      exit mouseUp
    end if
    aeStopMoving "all"
    lock screen
  -- I want them to start from the center, if they should move from anywhere, comment out the repeat loop
    repeat with i=1 to the number of buttons
        if the short name of btn i= the short name of me then next repeat
        set the loc of btn i to the loc of this cd
    end repeat

    unlock screen
    aeLockMoves
    repeat with i=1 to the number of buttons
        if the short name of btn i= the short name of me then next repeat
        aeMoveTo the long id of btn i,random(the width of this cd),random(the height of this cd),1000+random(1000),any item of "in,out,inout,bounce,overshoot,"
    end repeat
    aeUnlockMoves
end mouseUp

Hope that helps,

Malte





More information about the Use-livecode mailing list