MouseDown on Enter
J. Landman Gay
jacque at hyperactivesw.com
Tue Jan 1 16:48:19 EST 2019
Correction: you need to include more ways to turn off the dragging control:
local sColor
local sDragging
on mouseDown
put the cColor of the mouseControl into sColor
set the backcolor of the mouseControl to sColor
put true into sDragging
end mouseDown
on mouseUp
put the cColor of the mouseControl into sColor
put false into sDragging
end mouseUp
on mouseMove x,y
if sDragging then
get x,y -- force to variable
set the backcolor of controlAtLoc(it) to sColor
end if
end mouseMove
on mouseRelease
put false into sDragging
end mouseRelease
on mouseLeave
put false into sDragging
end mouseLeave
On 1/1/19 3:41 PM, J. Landman Gay via use-livecode wrote:
> On 1/1/19 9:23 AM, Richmond via use-livecode wrote:
>
>> 1. When one performs a mouseDown on each hexagon a tone is played.
>>
>> 2. While the mouse button is held down the tone continues to sound.
>>
>> 3. If the mouse is dragged (while being pressed) from one hexagon to
>> the next,
>> the sound changes from that of the initial hexagon to the new one.
>>
>> So . . . there would seem to be something "there" that is a bit
>> difficult to implement in LiveCode.
>
> Is this what you want? It requires that each hexagon has a custom
> property named "cColor" that contains an RGB value or a colorname. The
> script goes into a group or card, and manages all hexagons.
>
> local sColor
> local sDragging
>
> on mouseDown
> put the cColor of the mouseControl into sColor
> set the backcolor of the mouseControl to sColor
> put true into sDragging
> end mouseDown
>
> on mouseUp
> put the cColor of the mouseControl into sColor
> put false into sDragging
> end mouseUp
>
> on mouseMove x,y
> if sDragging then
> get x,y -- force to a variable
> set the backcolor of controlAtLoc(it) to sColor
> end if
> end mouseMove
>
> If the card has more objects than just the hexagons, you'll want to test
> the mouseControl so nothing happens with other objects. Or alternatly,
> group only the hexagons and put the script into the group.
>
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list