Lock Moves Bug?

Bridger Maxwell bridgeyman at gmail.com
Sat Dec 9 02:51:14 EST 2006


Hey,
  From the way the documentation reads, I would think that setting the lock
moves to true, issuing a few move commands, and setting the lockmoves to
false would start the move commands on all the objects at the same time.
But I can't get it to work that way.  Here is my script:

  lock moves
  set the lockMoves to true
  repeat with z = 1 to 10
    put "Contact" & z into vObj
    ---Here is where I had a lot of script to calculate newLoc
    move btn vObj to newLoc
  end repeat
  unlock moves
  set the lockMoves to false

When I run that they each move one after the other.  They do not start at
the same time.  Not only that, but it takes up time as if it is moving, but
I don't actually see the animation.  I made a simpler test script with only
two buttons and without a repeat loop and got the same result:

on test
  if the loc of btn "Move1" is the line 1 of the tooltip of btn "Move1" then
    put the line 2 of the tooltip of btn "Move1" into loc1
  else
    put the line 1 of the tooltip of btn "Move1" into loc1
  end if
  if the loc of btn "Move2" is the line 1 of the tooltip of btn "Move2" then
    put the line 2 of the tooltip of btn "Move2" into loc2
  else
    put the line 1 of the tooltip of btn "Move2" into loc2
  end if

  lock moves
  move btn "Move1" to loc1
  move btn "Move2" to loc2
  unlock moves
end test


Because I can't use the lockmoves, I am just making it move without
waiting.  Does this mean there is a bug, or am I just doing it wrong?

  TTFN
    Bridger



More information about the use-livecode mailing list