# Infinite Scroller Question

**URL:** <https://forum.kirupa.com/t/infinite-scroller-question/8484>\
**Category:** flash\
**Created:** [November 22, 2002, 2:34am UTC](https://forum.kirupa.com/t/infinite-scroller-question/8484 "2002-11-22T02:34:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![e\_radium](https://avatars.discourse-cdn.com/v4/letter/e/dc4da7/32.png) [@e\_radium](https://forum.kirupa.com/u/e_radium)\
**Post date:** [November 22, 2002, 2:34am UTC](https://forum.kirupa.com/t/infinite-scroller-question/8484/1 "2002-11-22T02:34:48Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 22, 2002, 12:06pm UTC](https://forum.kirupa.com/t/infinite-scroller-question/8484/2 "2002-11-22T12:06:47Z")

</div>

Hi,

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

```auto

// 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
