I have a horizontal scroll bar that runs across the bottom of my webpage that moves only when a user moves their mouse left or right over the movieclip area. Instead, I would like the scroller to be moving automatically and then stop whenever the mouse is over that area but I’m not sure how to go about it.
here is the code for the scroll function:
public function movemouse() // this mouse executes on an interval and it will verify if the mouse is on the scroller, in order to make it "move"
{
if ((_xmouse>0) && (_xmouse<actualMaskWidth) && (_ymouse<(settings.maskHeight+mask._y)) && (_ymouse>0)) {
var xm:Number = _xmouse-tol;
if (xm<0) {
xm = -3;
}
if (xm>(actualMaskWidth-2*tol)) {
xm = actualMaskWidth -2*tol;
}
xpos = Math.round((xm*(actualMaskWidth-actualLstWidth))/(actualMaskWidth-2*tol));
lst.onEnterFrame = function() {
if (Math.abs(this._x-xpos)<1) {
delete this.onEnterFrame;
if (tg == 1)
{
blur(0,this);
}
this._x = xpos;
return;
} else {
if (tg == 1)
{
if (Math.abs(xpos-this._x)>50) {
blur(Math.abs((xpos - this._x) / 12), this);
} else {
blur(0,this);
}
}
this._x += Math.round((xpos - this._x) / speed);
}
};
}
}
Any suggestions are appreciated, thank you