a script that does this:
movieClip clicked = start drag
if it is dragged to the LEFT 100pixels it stops drag and scrolls to the left that is -800pixels if it is dragged to the RIGHT 100pixels it stops drag it scrolles +800pixels.
movieClip on release = stop drag
it returns to its position before dragging.
I made this so far (DOESN’T WORK):
stop();
background.onPress = function () {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.startDrag();
}
mouseX= _xmouse;
onMouseMove = function () {
mouseX2 = mouseX - _xmouse;
if (mouseX2 > 100) {
this.stopDrag();
_root.lokacija1 = _root.background.targetx = background._x - Stage.width;
mouseX= 0;
mouseX2 = 0;
play();
} else if (mouseX2 < -100) {
this.stopDrag();
_root.lokacija1 = _root.background.targetx = background._x + Stage.width;
mouseX = 0;
mouseX2 = 0;
play();
}
}
}
background.onRelease = function () {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.stopDrag();
delete (mouseX2);
mouseX = 0;
mouseX2 = 0;
}
}