Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
on mouseUp
repeat with i=1 to 16
mex2 i
end repeat
end mouseUp
on mex2 index
move img index relative "0,60" in 10
wait 4 with messages
move ing index relative "0,-60" in 10
end mex2
I shortened the timing just so things would progress in a reasonable time frame.
But Max, why invoke a second handler when one will do? You can rewrite this in about one minute, I know.
I don't quite what exactly you are trying to do. But if it is the fact that your control with the mex2 script in pauses 2 seconds before going up again then you might want to have a look at "without waiting"
on mex2
move me relative "0,60" in 2 sec without waiting
wait 2 sec with messages
move me relative "0,-60" in 2 sec without waiting
end mex2
now the control moves down and then immediately up again. It does not wait 2 seconds when it is down as your script. In your script the whole thing takes 6 seconds and in "without waiting" it takes 4 seconds This is because move is blocking with "without waiting"
I can't understand the move command. If you look the video, when move has NOT the without waiting option, every image seems waiting the other images. Why this happen?
Every images receive its input, so every image should move independently from the others.
I'm very confused...
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
I think the issues derive from the fact that the move command sort of lives its own life. Please try this experiment. On a new card, make a button and four fields. In the button script:
on mouseUp
put 10 into moveTime
lock moves
repeat with i=1 to 4
move fld i relative "0,60" in moveTime without waiting
end repeat
unlock moves
wait moveTime with messages
lock moves
repeat with i=1 to 4
move fld i relative "0,-60" in moveTime without waiting
end repeat
end mouseUp
If anything new at all can be gleaned from the above nonsense, it is the introduction of the "lock/unlock moves" command.
dunbarx wrote:I think the issues derive from the fact that the move command sort of lives its own life. Please try this experiment. On a new card, make a button and four fields.
...
If anything new at all can be gleaned from the above nonsense, it is the introduction of the "lock/unlock moves" command.
Craig
Craig,
I know the lock/unlock moves, but it has more sense to me. Because only with this option you can perfectly synchronize some interactions.
My problem is that I want unsynchronized movements, I want independent movements; but I get now it's my turn style movements
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
local w=20
on mouseUp
put line 13 to 20 of the script of me into s
repeat with i=1 to 16
put ("b"&i) into b
if there is no btn b then create btn b
set rect of btn b to (i*w,i*w,i*w+30,i*w+20)
set script of btn b to s
send "mex2 40" to btn b in i*100 millisecs
end repeat
end mouseUp
on mex2 x
if the shiftkey is down then exit mex2
-- move me relative 0,x in 1 sec
move me relative 0,x in 1 sec without waiting
send "mex2 -x" to me in 1 sec
end mex2
then you can control exactly whats going by using "without waiting" or not, as Bernd proposes (and what the dictionary to "move" claims).
Hermann
p.s. Nice videos!
Last edited by [-hh] on Fri Feb 05, 2016 8:17 pm, edited 3 times in total.
If you remove all the "without waiting" in the example, the controls move in sequential order. is this closer to what you want? I suspect it is not exactly what you want, however.
That was terrific insight. This should be useful for many.
I would love to see a repository of clever solutions, not quite suitable for the "Sample Stacks" site, though one could make a stack that simply demonstrated techniques or solved problems, but rather an annotated library of handlers.
You might say that we already have this in the forum. But try to find this thread in a year. Keyword searches would do it, but how could a user even start to know what keywords are going to yield results?
One of my teachers was Craig N. (and Bernd N. for the animation part)
Craig wrote:I would love to see a repository of clever solutions, not quite suitable for the "Sample Stacks" site, though one could make a stack that simply demonstrated techniques or solved problems, but rather an annotated library of handlers.
MaxV will make a short summary (he started already with the listing above) of what he's doing on his site, not too complicated, isn't it Massimiliano?
And we will improve our knowledge of italian language by that ...