views:

19

answers:

1

I have a MovieClip that I want the user to be able to drag inside the stage, but I don't want it to be able to move outside the stage.

Currently I'm using this._parent.startDrag(); to allow the MC to be dragged, but I don't know how to stop it from being dragged outside the frame.

+2  A: 

The startDrag method has some optional parameters to constrain where you can drag, so you could use:

this._parent.startDrag(false, 0, 0, Stage.width, Stage.height);

There's a full description in the Adobe AS2 docs

Richard Inglis