Setting boundries for "pressmove".
I want to set the x boundry of an object so it stops dragging between set values. For example, you can drag the object between 50px and 500px.
What code can I add to the following to achieve this?
var root = this;
var Cucumber = root.Cucumber;
createjs.Touch.enable(stage);
Cucumber.on("mousedown", function (e) {
e.currentTarget.offsetX = stage.mouseX / stage.scaleX - e.currentTarget.x;
});
Cucumber.on("pressmove", function (e) {
e.currentTarget.x = stage.mouseX / stage.scaleX - e.currentTarget.offsetX;
});
