To grab or not to grab
Ken Norris (dialup)
pixelbird at interisland.net
Wed Jan 29 15:58:01 EST 2003
**********
> Date: Wed, 29 Jan 2003 18:45:57 +1100
> Subject: Re: To grab or not to grab
> From: Matt Denton <matt.denton at limelight.com.au>
> Geoff, any clues how I might get an object to stay within the rect of
> its contained group? I tested the form below (my original code was
> similar to this) but it doesn't work,
----------
Hi,
This is not quite the RR way of doing things, but perhaps it will provide a
clue as to what you need:
on mousestilldown
put "100,100,200,200" into bounds
put max(item 1 of bounds,min(item 3 of bounds,the mouseh)) into x
put max(item 2 of bounds,min(item 4 of bounds,the mousev)) into y
set the loc of me to x,y
end mousestilldown
...the keys being the min/max functions.
HTH,
Ken N.
More information about the use-livecode
mailing list