Bill
Bill

Reputation: 19268

AS3, is there a way to attach function when use startDrag

Just wondering if there is a way you can attach a function while startDrag and constantly check the position of the event target.

Upvotes: 0

Views: 104

Answers (1)

Urosan
Urosan

Reputation: 321

Applay mouse listener to dragged element. Somethink like code bellow.

draggedElement.addEventListener(MouseEvent.MOUSE_MOVE, checkPositionHandler)
private function checkPositionHandler(e:MouseEvent){
   // e.currentTarget.x
   // e.currentTarget.y
}

Upvotes: 1

Related Questions