Drag with limitation (an externally loaded MC)


Soon i hope to have the knowledge to awnser questions on this forum for now i can only ask. Sorry for that.

I’m working on this portfoliosite where you can drag externally loaded images. At the moment unfortunatelly it is possible to drag them outside the mask and in all directions. I want them to be limited in their movements and everytime when i load another image in the dragged movieclip the loction should be the starting position again.

so my 3 questions of today are:

  1. how do i block the up-down movement for dragging (used the startDrag)?
  2. how do i limit the left and right movement of the draggable externally loaded image? (limit is the width of the loaded image, wich is always different)
  3. how do i reset the location of the dragged mc when i load a new image in it?

[url=“http://www.thijspulles.com/kirupa/drag.swf”]Link to visualise my problem. click on the rectangles and drag.

zipped fla + images

thanks for helping!
thanks for helping!