Lock Moves does not work
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Lock Moves does not work
I tried moving 2 small graphic images using this code.
on mouseUp
set the lockMoves to true
move grc "Fish2" to 30,30
move grc "Fish3" to 60,60
set the lockMoves to false
end mouseUp
Each image took turns jumping to the new location instead of moving smoothly at the same time. Is there a way If you want to move more than one object simultaneously?
on mouseUp
set the lockMoves to true
move grc "Fish2" to 30,30
move grc "Fish3" to 60,60
set the lockMoves to false
end mouseUp
Each image took turns jumping to the new location instead of moving smoothly at the same time. Is there a way If you want to move more than one object simultaneously?
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Lock Moves does not work
Hi Max,
Add without waiting
move grc "Fish2" to 30,30 without waiting
move grc "Fish3" to 60,60 without waiting
That will work for you.
Simon
Add without waiting
move grc "Fish2" to 30,30 without waiting
move grc "Fish3" to 60,60 without waiting
That will work for you.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Lock Moves does not work
Thanks Simon for responding to this message so quickly (without waiting).
Max
Max
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Lock Moves does not work
HA!
Your message contains 3 characters. The minimum number of characters you need to enter is 10.
Your message contains 3 characters. The minimum number of characters you need to enter is 10.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Lock Moves does not work
Yah yah, I know, reviving an older thread again
However, while the pointed out without waiting method *does* work, I am curious as to why 'lockMoves' does not appear to work as listed in the dictionary, tested in Lc vers. 6.5 to 9.x dp.
In testing it, I have some 5 "bubbles" that I would like to move along 5 paths (created with the freehand tool). Here is a picture of the final result, the bubbles on the right are what I wanted the final positioning to be, and do not move (they will be removed later), the lines are the drawn paths, and of course the bubbles are in their final position -
According to the dictionary, setting lockMoves to true and then moving the bubbles along the path of the lines, finally setting lockMoves to false should cause all the moves to wait, then move all at once.
Of course, this does not happen, instead each bubble shows the start and end of its journey instead? The code used is pretty generic, I just want to make sure I am using it correctly:
Having failed to get lockMoves working properly, I did finally find this thread. The 'withoutWaiting' *does* work, however the "bubbles" move very jerkily, where moving them one at a time moves them close to ideally.
If anyone can explain, I'd love to hear it
However, while the pointed out without waiting method *does* work, I am curious as to why 'lockMoves' does not appear to work as listed in the dictionary, tested in Lc vers. 6.5 to 9.x dp.
In testing it, I have some 5 "bubbles" that I would like to move along 5 paths (created with the freehand tool). Here is a picture of the final result, the bubbles on the right are what I wanted the final positioning to be, and do not move (they will be removed later), the lines are the drawn paths, and of course the bubbles are in their final position -
According to the dictionary, setting lockMoves to true and then moving the bubbles along the path of the lines, finally setting lockMoves to false should cause all the moves to wait, then move all at once.
Of course, this does not happen, instead each bubble shows the start and end of its journey instead? The code used is pretty generic, I just want to make sure I am using it correctly:
Code: Select all
on openStack
// set the lockMoves to true <- first attempt, I tried it here, bubbles move to beginning, then jump to end...
// move the bubbles to their starting position...
set the location of graphic "bubOne" to 113,395
set the location of graphic "bubTwo" to 106,391
set the location of graphic "bubThree" to 5,395
set the location of graphic "bubFour" to 137,394
set the location of graphic "bubFive" to 103,390
// this starts the move handler...
moveBubbles
end openStack
on moveBubbles
// set the lockMoves to true <- tried it again here, same result...
move graphic "bubOne" to the points of graphic "mainPathOne" in 3 seconds
move graphic "bubTwo" to the points of graphic "mainPathTwo" in 3 seconds
move graphic "bubThree" to the points of graphic "mainPathThree" in 3 seconds
move graphic "bubFour" to the points of graphic "mainPathFour" in 3 seconds
move graphic "bubFive" to the points of graphic "mainPathFive" in 3 seconds
// set the lockMoves to false
end moveBubbles
If anyone can explain, I'd love to hear it
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Lock Moves does not work
Hi Bogs,
I tried this with version 5.5, 6.7 and 9 DP8 and it worked
Just don't expect to move too many objects at once smoothly for complex/large graphics and paths with many points. It needs a bit fine tuning.
That said my three graphics (oval 120*120) moved along pathes with about 100 points fairly smoothly.
Kind regards
Bernd
I tried this with version 5.5, 6.7 and 9 DP8 and it worked
Code: Select all
on openStack
moveBubbles
end openStack
on moveBubbles
lock moves
move graphic "g1" to the points of graphic "p1" in 3 seconds without waiting
move graphic "g2" to the points of graphic "p2" in 3 seconds without waiting
move graphic "g3" to the points of graphic "p3" in 3 seconds without waiting
unlock moves
end moveBubbles
That said my three graphics (oval 120*120) moved along pathes with about 100 points fairly smoothly.
Kind regards
Bernd
Re: Lock Moves does not work
Heya Bernd !
To see what I mean about lock moves, try that code either without the 'lock moves' or without the 'without waiting'.
If you drop 'lock/unlock moves', you'll see absolutely no difference in the behavior, because "without waiting" is actually doing the work.
If you use lockMoves, lock moves, or any other combination, the effect doesn't work as the dictionary states.
In other words, the variation of lock moves commands appear to be not working as intended, at least according to documentation in the dictionary.
I don't have a vers. of Lc before 6.0, so I don't know if it ever worked below that, but sure doesn't seem to work from 6.0 up in the community additions.
Bonus if anyone knows if it actually works in the pay for editions, maybe somehow that is the difference?
The smoothness I'm not really worried about, as you say that will take some fine tuning of the code itself
To see what I mean about lock moves, try that code either without the 'lock moves' or without the 'without waiting'.
If you drop 'lock/unlock moves', you'll see absolutely no difference in the behavior, because "without waiting" is actually doing the work.
If you use lockMoves, lock moves, or any other combination, the effect doesn't work as the dictionary states.
In other words, the variation of lock moves commands appear to be not working as intended, at least according to documentation in the dictionary.
I don't have a vers. of Lc before 6.0, so I don't know if it ever worked below that, but sure doesn't seem to work from 6.0 up in the community additions.
Bonus if anyone knows if it actually works in the pay for editions, maybe somehow that is the difference?
The smoothness I'm not really worried about, as you say that will take some fine tuning of the code itself
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Lock Moves does not work
Moving multiple objects (SOLVED)
http://forums.livecode.com/viewtopic.php?f=7&t=26480
http://forums.livecode.com/viewtopic.php?f=7&t=26480
shiftLock happens
Re: Lock Moves does not work
Heya -hh
Thank you for the very helpful posting you linked to, I have read it, and look forward to using it to refine what I know to work currently, but for the question at hand would you know the answer?
Just to summarize -
- lockMoves, lock moves, and the unlock version of each doesn't seem to work as intended, at least not by the dictionary definition/summary/comments or examples.
- the end of the statement "without waiting" appears to actually do the work of making the movement "look" simultaneous.
Does anyone disagree with that assessment? If so, feel free to expound on what I might be missing, this really is just for learning for me, but may be important to someone else going forward.
Thank you for the very helpful posting you linked to, I have read it, and look forward to using it to refine what I know to work currently, but for the question at hand would you know the answer?
Just to summarize -
- lockMoves, lock moves, and the unlock version of each doesn't seem to work as intended, at least not by the dictionary definition/summary/comments or examples.
- the end of the statement "without waiting" appears to actually do the work of making the movement "look" simultaneous.
Does anyone disagree with that assessment? If so, feel free to expound on what I might be missing, this really is just for learning for me, but may be important to someone else going forward.
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Lock Moves does not work
Hi Bogs,
try this code and block/unbloc "lock moves"/"unlock moves"
so lock moves does do something
Kind regards
Bernd
try this code and block/unbloc "lock moves"/"unlock moves"
Code: Select all
on moveBubbles
lock moves
move graphic "g1" to the points of graphic "p1" in 3 seconds without waiting
wait 1 second
move graphic "g2" to the points of graphic "p2" in 3 seconds without waiting
wait 1 second
move graphic "g3" to the points of graphic "p3" in 3 seconds without waiting
unlock moves
end moveBubbles
the paid for editions have the same code base as the community editions. So what is in the community edition works just like in the paid-for ones. They do have some additional functionality but that is not a "better" version as far as the functions included in the open source version is concerned.Bonus if anyone knows if it actually works in the pay for editions, maybe somehow that is the difference?
Kind regards
Bernd
Re: Lock Moves does not work
Heya Bernd !
I do want to point out that I never said it did "nothing", just that it does not appear to operate as the dictionary says it *should*.
On all of the tests I ran, it did indeed do something, just not what you might expect after reading the dictionary entry for it, and that dictionary entry is in all the editions up to current.
Btw, clever use of the wait statements, it was a test I did not run previously, and it did add an interesting element to it
I do want to point out that I never said it did "nothing", just that it does not appear to operate as the dictionary says it *should*.
On all of the tests I ran, it did indeed do something, just not what you might expect after reading the dictionary entry for it, and that dictionary entry is in all the editions up to current.
Btw, clever use of the wait statements, it was a test I did not run previously, and it did add an interesting element to it