# Help with AS scrolling gallery

**URL:** <https://forum.kirupa.com/t/help-with-as-scrolling-gallery/224998>\
**Category:** Uncategorized\
**Created:** [May 7, 2007, 10:59pm UTC](https://forum.kirupa.com/t/help-with-as-scrolling-gallery/224998 "2007-05-07T22:59:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg76](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@greg76](https://forum.kirupa.com/u/greg76)\
**Post date:** [May 7, 2007, 10:59pm UTC](https://forum.kirupa.com/t/help-with-as-scrolling-gallery/224998/1 "2007-05-07T22:59:32Z")

</div>

Howdy!

I have this scrolling gallery which is based on this script:  
[http://www.kirupa.com/developer/mx/infinite.htm](http://www.kirupa.com/developer/mx/infinite.htm)

I have this little bit of code here:

```auto

onClipEvent (load)
{
ycenter=205;
speed=1/15;
}

onClipEvent (enterFrame)
{
var distance=_root._ymouse-ycenter;
_y+=(distance*speed);

if (_y > 0) _y=-410;
if (_y < -410) _y=0;
}

```

Problem is, that I angled my MC, so there is a gap between top left \_y and bottom left \_y, hence, the MC ‘jumps’ when the values are reseted.

![](http://www.e-mc2.com/greg/gallery.jpg)

Theoretically I know what I have to do:  
when \_y reaches certain position, I have to change \_x value, so my MC is moved either to the left or to the right.

I wanted to manipulate \_x position, so visually it stays always in the center. But my knowledge of AS is next to nothing, and really I have no idea where to start from.

I was wondering if anybody could help me out with that?  
Thank you!

Best Regards,  
~g.
