Issue with making mousemove working with touch
Hi there,
I'v used your expmple for scroll bar : https://community.adobe.com/t5/animate/slider-to-control-timeline/td-p/9909532
I need to to controll the volume. So far it's working while using mouse move, my issue is with how to make it working also with touch.
I'v added this line: createjs.Touch.enable(stage);
All the other gestures are working proprely with mouse+touch, just this function not working with touch.
Thank you for helping!
this is the function:
$(document).mousemove(function () {
if (isCreateV == true && volControler.currentFrame == 1) {
volControler.button.on("mousedown", function (e) {
e.target.offsetX = (e.stageX / stage.scaleX) - e.target.x;
}.bind(volControler));
volControler.button.on("pressmove", function (e) {
e.target.x = volControler.clamp((e.stageX / stage.scaleX) - e.target.offsetX, (volControler.bar.x - 200), (volControler.bar.x + volControler.bar.nominalBounds.width) - 200);
volControler.setProportion();
}.bind(volControler));
volControler.setProportion = function () {
var prop = (volControler.button.x - (volControler.bar.x - 200)) / (volControler.bar.nominalBounds.width);
//volControler.txt.x = volControler.button.x;
//volControler.txt.text = prop;
createjs.Sound.volume = prop;
if (prop == 1) {
volControler.bar.gotoAndStop(59);
} else {
volControler.bar.gotoAndStop(volControler.bar.timeline.duration * prop);
}
}.bind(volControler);
volControler.clamp = function (value, min, max) {
if (value < min)
return min;
else if (value > max)
return max;
else
return value;
}
setTimeout(volControler.setProportion, 0);
}
});
