I am adding an area  image capture function to an one of my stacks. I would like a click and drag interface for designating the area to be captured. While the area is being dragged out, I want the mouse to draw a rectangle so the user can see the area being captured. I have been trying to do this with a rectangle graphic. but I cannot seem to get the rectangle to resize as it is being moved. Here is what I have so far
Code: Select all
on mouseDown
    global tFirstCord
    put the mouseLoc into tFirstCord
   set the topLeft of graphic dragArea to mouseLoc()
   set the visible of graphic dragArea to true
end mouseDown 
on mouseMove
     global tSecondCord
   put the mouseLoc into tSecondCord
     set the bottomRight of graphic dragArea to mouseLoc()
end mouseMove
on mouseUp
   global tFirstCord
   global tSecondCord
   set the visible of graphic dragArea to false
 end mouseUp
How can I lock the topLeft property so that when I change the bottomRight property the rectangle will resize instead of moving? Or am I completely on the wrong track?