georgekaplin
May 20th, 2002, 07:58 AM
How would you script the movement limitations to create a diagonal slider? Im not looking for anything tricky. Just a plain 45 degree, .785 rads, um i think ;) angle movement.
My current Horizontal slider is as follows.
onClipEvent (load) {
        min=50;
        max=400;
        percent = Math.floor((_x-min)/(max-min)*100);
}
onClipEvent (mouseMove) {
        if (drag==1){
                _x=_root._xmouse+offsetX;
        if (_x>400){
                _x=400;
        }
        if (_x<50){
                _x=50;
        }
        percent = Math.floor((_x-min)/(max-min)*100) ;
        updateAfterEvent ()}
}
My current Horizontal slider is as follows.
onClipEvent (load) {
        min=50;
        max=400;
        percent = Math.floor((_x-min)/(max-min)*100);
}
onClipEvent (mouseMove) {
        if (drag==1){
                _x=_root._xmouse+offsetX;
        if (_x>400){
                _x=400;
        }
        if (_x<50){
                _x=50;
        }
        percent = Math.floor((_x-min)/(max-min)*100) ;
        updateAfterEvent ()}
}