Constraining drag and drop
I have a bar symbol that I need to constrain to vertical movement as well as just how far it can go up and down when dragged. I have been looking at the constrain js function but cannot quite figure it out. Here's the script without constraint. I think it is fairly simply to add a constraint function, but I'm not quite sure how.
var startDrag = startDragF.bind(this);
this.Bar1.addEventListener("pressmove", startDrag);
function startDragF(e){
var p = stage.globalToLocal(e.stageX, e.stageY);
e.currentTarget.x = p.x;
e.currentTarget.y = p.y;
}
