How does scope work in Drag events? This doesn't reset the layer to the start location.
draggy = new Layer
draggy.on Events.DragStart, -> startX = draggy.x startY = draggy.y
draggy.on Events.DragEnd, -> draggy.x = startX draggy.y = startY
Yep, that's a scoping problem. Those two dragging events you have there will become functions when compiled to JS. You need to declare startX=0 and startY=0 in the same scope you're declaring draggy
Or... One simpler way is to attach the value to the layer...
Inside your DragStart...
draggy.startPoint = draggy.point
Inside your DragEnd...
draggy.x = draggy.startPoint.xdraggy.y = draggy.startPoint.y
The point property is your friend.
Or.... Duh moment... In your DragEnd
draggy.point = draggy.startPoint