Scott, why do you need the mouseRelease handler? Just wondering.
-Chipp -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Scott Rossi Sent: Tuesday, November 27, 2001 12:21 PM To: [EMAIL PROTECTED] Subject: Re: Constraining Movement Recently, Mark MacKenzie (Shaw) wrote: > I have a small graphic based group which upon "mousemove" etc. is grabbed by > the mouse cursor and moved. It is placed (originally and I would like it to > stay here too!) within the borders an image which is some 3 times the area > of the moveable graphic. I have been unsuccessful in constraining the > movement of the graphic group to within this image. Here's another (simpler?) option that seems to work for me: on mouseDown set the uAllowDrag of me to true end mouseDown on mouseMove if not the uAllowDrag of me then exit mouseMove set the loc of me to \ min(max(the mouseH,left of img myImg + (width of me/2)),\ right of img myImg - (width of me/2)),\ min(max(the mouseV,top of img myImg + (height of me/2)),\ bottom of img myImg - (height of me/2)) end mouseMove on mouseUp set the uAllowDrag of me to false end mouseUp on mouseRelease mouseUp end mouseRelease Regards, Scott _____________________________________________________________________ Scott Rossi Tactile Media - Multimedia & Design Creative Director Email: [EMAIL PROTECTED] Web: www.tactilemedia.com
