I am using the following code as a mouse mover for a movie clip. Can anyone
tell me if there is a way to increase the dead-zone where the mc won't scroll
in the middle.
Any help would be appreciated.
function scrollPlaylist() {
// set an enterframe function for the scrolling
tempForward.onEnterFrame = function() {
// scroll playlist if needed
if (this.hitTest(_root._xmouse, _root._ymouse) == true) {
// determine relative mouse position
var mpos = this._xmouse/this._width*this._xscale*0.02-1;
// determine max, min and current playlist _x
var ply = firePlace._x;
var maxx = this._x;
var minx = this._x-firePlace._width+this._width;
if (ply>maxx-5 && mpos<0) {
firePlace._x = maxx;
} else if (ply<minx+5 && mpos>0) {
firePlace._x = minx;
} else {
firePlace._x -= Math.floor(mpos*15);
}
}
};
}
scrollPlaylist();
sadfba - 31 May 2008 15:31 GMT
Solved
function scrollPlaylist() {
// set an enterframe function for the scrolling
tempForward.onEnterFrame = function() {
// scroll playlist if needed
if (this.hitTest(_root._xmouse, _root._ymouse) == true) {
// determine relative mouse position
var mpos = this._xmouse/this._width*this._xscale*0.02-1;
trace(mpos);
// determine max, min and current playlist _x
var ply = firePlace._x;
var maxx = this._x;
var minx = this._x-firePlace._width+this._width;
if (ply>maxx-5 && mpos<0) {
firePlace._x = maxx;
} else if (ply<minx+5 && mpos>0) {
firePlace._x = minx;
} else if (mpos <= -.5) {
firePlace._x -= Math.floor(mpos*20);
} else if (mpos >= .5) {
firePlace._x -= Math.floor(mpos*20);
}
}
};
}