# Image scroller isn't looping

**URL:** <https://forum.kirupa.com/t/image-scroller-isnt-looping/205666>\
**Category:** flash\
**Created:** [October 31, 2006, 7:50pm UTC](https://forum.kirupa.com/t/image-scroller-isnt-looping/205666 "2006-10-31T19:50:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcginess13](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@mcginess13](https://forum.kirupa.com/u/mcginess13)\
**Post date:** [October 31, 2006, 7:50pm UTC](https://forum.kirupa.com/t/image-scroller-isnt-looping/205666/1 "2006-10-31T19:50:34Z")

</div>

Hi all,

I’m making a product image scroller. Basically it starts by showing about 7 products and then when the user’s mouse moves left or right it scrolls through the rest of the product images. I have no problem getting it to move from left to right, but then it just stops on the last product without looping. The looping code I was doing was awful, so I just removed and kept what works for the sake of this post. It’s a 3 frame movie, with a background and a mask around the rest of the products.

Here’s my ActionScript:

mouseX = \_xmouse;  
menuX = menu.\_x;

if (mouseX \> 399) {  
diff = (mouseX-399)/45;  
}  
if (mouseX \< 379) {  
diff = (379-mouseX)/45;  
}  
if (mouseX \<= 389 && menuX \<= 132) {  
setProperty(“menu”, \_x, menuX+diff);  
}  
if (mouseX \>= 389 && menuX \>= -250) {  
setProperty(“menu”, \_x, menuX-diff);  
}  
if (menu.\_x \>= 132) {  
menu.\_x = 132;  
} else if (menu.\_x \<= -257) {  
menu.\_x = -257;  
}  
gotoAndPlay(1);
