0 Replies - 1534 Views - Last Post: 16 November 2010 - 11:57 AM

#1 Guest_stein149*


Reputation:

as2 CS4 - Horizontal Scroll bar

Posted 16 November 2010 - 11:57 AM

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 ideas are appreciated, thanks

Is This A Good Question/Topic? 0

Page 1 of 1