MouseMove . . . err?
J. Landman Gay
jacque at hyperactivesw.com
Fri Dec 12 12:38:27 EST 2008
Richmond Mathewson wrote:
> Just knocked together a silly little stack with 4 buttons called
> "X1", "X2", "X3" and "X4". Now I want them to chase my cursor in
> a quad shape, and to do that I popped this script into my card:
>
> on mouseMove
> set the moveSpeed to 10000
> put item 1 of the mouseLoc into MISHKA1
> put item 2 of the mouseLoc into MISHKA2
> move btn "X1" to (MISHKA1 + 40), (MISHKA2 + 40)
> move btn "X2" to (MISHKA1 - 40), (MISHKA2 + 40)
> move btn "X3" to (MISHKA1 + 40), (MISHKA2 - 40)
> move btn "X4" to (MISHKA1 - 40), (MISHKA2 - 40)
> end mouseMove
>
> [ find "MISHKA.rev" at revOnline, under 'Richmond' ]
>
> but the buttons behave a bit oddly (cannot describe it, has to
> be seen to be understood).
I didn't actually look at it, but from the description I'd say that each
mouseMove message (which is sent many, many times per second) is
triggering a new set of "move" commands, which will interfere with the
move commands already executing. I wouldn't use a movemove handler to
trigger this behavior. MouseEnter or something else that is sent only
once would be a better choice.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list