Lock Moves Bug?

Mark Schonewille m.schonewille at economy-x-talk.com
Sat Dec 9 17:28:50 EST 2006


Hi Bridger,

You don't need to lock moves and set the lockMoves as well. They do  
the same.

I ran the following script:

on mouseUp
   set the loc of graphic "Green" to 20,20
   set the loc of graphic "Red" to 20,60
   lock moves
   move graphic "Green" to 200,2 in 2 secs
   move graphic "Red" to 200,60 in 2 secs
   unlock moves
end mouseUp

and expected the two graphics to start moving at the same time, after  
executing the unlock moves command. This didn't happen. Instead, the  
first graphic moves after two seconds, then the script waited 2  
seconds before moving the second graphic.

The documentation says:

"The time specifies a total time for the move to take from start to  
end, in milliseconds, seconds, or ticks."

but this is definitely not what is happening. I am sure that this is  
a bug, either in the Rev engine or in the docs.

Eric's suggestion to move without waiting works for me:

   move graphic "Green" to 200,2 without waiting
   move graphic "Red" to 200,60 without waiting

Just make sure to set the moveSpeed if you want the graphics to move  
faster or slower.

Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Get your store on-line within minutes with Salery Web Store software.  
Download at http://www.salery.biz

Op 9-dec-2006, om 8:51 heeft Bridger Maxwell het volgende geschreven:

> 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