Hi I’m migrating from as2 to as3 and have a problem. I have a movieclip called papel_ilus which has loaded images inside with text and stuff. I found a Drag And Drop code that constrains the movement of the _x axis and have targeted the papel_ilus movieclip. However, when I click the images inside they are dragged separately from the whole movieclip I targeted and everything is a mess. Is there a way to drag the whole “pack” as one? Here is the code I’m using:
import flash.geom.Rectangle;
var leftY:int = 0;
var rightY:int = 0;
papel_ilus.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
papel_ilus.addEventListener(MouseEvent.MOUSE_UP, onUp);
function onDown(e:MouseEvent):void
{
var constrainY:Rectangle = new Rectangle(e.target.x, e.target.x, rightY, 110);
e.target.startDrag(false, constrainY);
}
function onUp(e:MouseEvent):void
{
e.target.stopDrag();
}
Thank you very much in advance!