Drag n Drop Objects in Flash vs. Rev

Graham Samuel livfoss at blueyonder.co.uk
Thu Dec 4 03:52:23 CST 2003

On Thu, 4 Dec 2003 08:23:54 +1000, Sarah <sarahr at genesearch.com.au> wrote:
>Check out:
>	http://lists.runrev.com/pipermail/use-revolution/2002-March/002702.html

IN this, Geoff Canyon says:

on mouseDown
     put true into tDragging
end mouseDown

on mouseMove mouseX,mouseY
     if tDragging then
-- Do bounds checking here --
         set the loc of me to (mouseX,mouseY)
     end if
end mouseMove

on mouseUp
end mouseUp

on mouseRelease
end mouseRelease

on stopDragging
     put false into tDragging
end stopDragging

IMHO, the **only** reason to use a scheme like this is in order to 
constrain the dragged object completely, i.e. so that the user can't 
move the object out of some chosen bounds (say a particular 
rectangle) even while dragging. If Monte is content to allow the user 
to drag an object anywhere in a window and then apply the constraints 
when the user lets go of the mouse (giving a kind of rubber-band 
effect, which can look quite attractive in some circumstances), then 
it seems to me that there is only one elegant solution, which is to 
use 'grab me' - it's built in and it's very concise. In the 
'rubber-band' case, I can't see any need for any other solution.

Just two more Eurocents

          Graham Samuel / The Living Fossil Co. / UK & France

More information about the use-livecode mailing list