startDrag bounds in AS3

The startDrag function in AS3 is a little different from in AS2: you define a rectangle from the initial location that you’re starting the drag from rather than the absolute bounds like in AS2.

So the code looks like below:

import flash.geom.Rectangle;
myMC.startDrag(false, new Rectangle(topX, topY, withToDrag, heightToDrag);
Tech Reference:

Leave a Reply

Your email address will not be published. Required fields are marked *

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑