Infinite Scroller Question

Okay, so I’m working the infinite scroller tutorial into a site that I’m building right now. Here’s the problem: I only want it to respond to the mouse’s x-position when the cursor is within the region of the scroller itself. That is, I want it to slow to a stop whenever the person browsing the site is looking at a different part of the page. I tried setting up some actionscript logic to do this, but it’s not working quite right. How do I do this?

I found an example of a website with an infinite scroller that works the way I want it to:

http://www.michaeljackson.com/splash-f.html
(go to the “short films” section, and click on one of the clips, and it will go show the infinite scroller that I’m referring to.)

Thanks,
e|radium

Hi,

This piece of code may help you. It’s not infinite but you can ad that bit.


// centerx in your case would be _root._xmouse
//inertia is a decimal number ( ie : 0.80 ) 
//k is a centesimal number (ie : 0.01)
MovieClip.prototype.scrollAClip = function(centerx, inertia, k,) {
	this.x = -this._x+centerx;
	this.xp = this.xp*inertia+this.x*k;
	this._x += this.xp;
};

Cheers

SHO