# In desperate need of help with infinite scroll

**URL:** <https://forum.kirupa.com/t/in-desperate-need-of-help-with-infinite-scroll/278513>\
**Category:** flash\
**Created:** [December 31, 2008, 4:26pm UTC](https://forum.kirupa.com/t/in-desperate-need-of-help-with-infinite-scroll/278513 "2008-12-31T16:26:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![melia05](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@melia05](https://forum.kirupa.com/u/melia05)\
**Post date:** [December 31, 2008, 4:26pm UTC](https://forum.kirupa.com/t/in-desperate-need-of-help-with-infinite-scroll/278513/1 "2008-12-31T16:26:59Z")

</div>

I have been trying to figure this problem out for a while and can’t seem to get it to work the way I want, I think I am on the right track, just missing something!

Could someone help me take the thumbnail scroller from this Kirupa tutorial ([http://www.kirupa.com/developer/mx2004/thumbnails.htm](http://www.kirupa.com/developer/mx2004/thumbnails.htm)) and make it an inifinite scroll? I have tried incorporating the idea from this other tutorial ([http://www.kirupa.com/developer/mx/infinite.htm](http://www.kirupa.com/developer/mx/infinite.htm)) but like I said, I can’t seem to get it to work!

Here is my code… I have tweaked it quite a bit as I can’t use XML and just want to scroll a movieclip!

[COLOR=Red]this.createEmptyMovieClip(“tscroller”, 1000);  
scroll\_speed = 10;  
tscroller.onEnterFrame = function() {  
if ((\_root.\_ymouse\>=thumbnail\_mc.\_y) && (\_root.\_ymouse\<=thumbnail\_mc.\_y+thumbnail\_mc.\_height)) {  
if ((\_root.\_xmouse\>0) && (\_root.\_xmouse\>=(hit\_right.\_x-100)) && (thumbnail\_mc.hitTest(hit\_right))) {  
thumbnail\_mc.\_x -= scroll\_speed;  
thumbnail\_mc.\_x= -1200;  
} else if ((\_root.\_xmouse\< -1200) && (\_root.\_xmouse\<=(hit\_left.\_x+100)) && (thumbnail\_mc.hitTest(hit\_left))) {  
thumbnail\_mc.\_x += scroll\_speed;  
thumbnail\_mc.\_x=0;  
}  
} else {  
delete tscroller;  
}  
};[/COLOR]

I also tried this…

[COLOR=Red]this.createEmptyMovieClip(“tscroller”, 1000);  
scroll\_speed = 10;  
tscroller.onEnterFrame = function() {  
if ((\_root.\_ymouse\>=thumbnail\_mc.\_y) && (\_root.\_ymouse\<=thumbnail\_mc.\_y+thumbnail\_mc.\_height)) {  
if ((\_root.\_xmouse\>=(hit\_right.\_x-100)) && (thumbnail\_mc.hitTest(hit\_right))) {  
thumbnail\_mc.\_x -= scroll\_speed;  
if (\_root.\_xmouse\>0){  
thumbnail\_mc.\_x= -1200;}  
} else if ((\_root.\_xmouse\<=(hit\_left.\_x+100)) && (thumbnail\_mc.hitTest(hit\_left))) {  
thumbnail\_mc.\_x += scroll\_speed;  
if (\_root.\_xmouse\< -1200){  
thumbnail\_mc.\_x=0;}  
}  
} else {  
delete tscroller;  
}  
};[/COLOR]
