Polling the mouse state
Ken Norris (dialup)
pixelbird at interisland.net
Sat Feb 23 20:41:01 EST 2002
on 2/23/02 12:47 PM, Scott Rossi at scott at tactilemedia.com wrote:
> If I understand your request, this is one way you could do the above. Make
> 3 small graphics named box 1, box 2 and box 3 within the region you define.
> Then place the following script in your oval:
>
> on mouseDown
> set the uAllowMove of me to true
> end mouseDown
>
> on mouseMove x,y
> if not the uAllowMove of me then exit mouseMove
> set the loc of me to (max(81,min(557,x))),(max(167,min(287,y)))
> end mouseMove
>
> on mouseUp
> set the uAllowMove of me to empty
> put "box1,box2,box3" into bList
> repeat for each item B in bList
> if within(me,loc of grc B) then
> put "You found box" && B
> exit repeat
> else put empty
> end repeat
> end mouseUp
----------
This much I understand. I have 10 objects in each card, but the principal is
the same.
-----------
> on mouseRelease
> mouseUp
> end mouseRelease
----------
Is this some kind of backup redundancy for PC's? As far as I know, the
mouseUp message gets sent automatically when you release the mouse, and
doesn't need a separate handler.
----------
> This should display the name (in the message box) of any box graphic that
> falls within the oval when the mouse is released.
>
> BTW, did you look at the drag example I posted a few days ago?
>
> http://www.tactilemedia.com/download/drag_sample.mc
----------
I haven't yet. I couldn't get it to DL. I'm using a Mac. I'll try again
later.
Thanks somuch,
Ken N.
More information about the use-livecode
mailing list