# Scroll in the opposite direction?

**URL:** <https://forum.kirupa.com/t/scroll-in-the-opposite-direction/11667>\
**Category:** flash\
**Created:** [January 20, 2003, 10:13pm UTC](https://forum.kirupa.com/t/scroll-in-the-opposite-direction/11667 "2003-01-20T22:13:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![skaiwayne2](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@skaiwayne2](https://forum.kirupa.com/u/skaiwayne2)\
**Post date:** [January 20, 2003, 10:13pm UTC](https://forum.kirupa.com/t/scroll-in-the-opposite-direction/11667/1 "2003-01-20T22:13:30Z")

</div>

Im using the infinite menu, but instead of scrolling to the right when you mouseover the right and so forth, I want to scroll in the opposite direction. When I mouseover the right side I want the movie to scroll left. Any help is greatly appreciated…

---

<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:** [January 20, 2003, 10:20pm UTC](https://forum.kirupa.com/t/scroll-in-the-opposite-direction/11667/2 "2003-01-20T22:20:21Z")

</div>

Negate the equation.

The equation that makes the menu run (probably says something like clip.\_x += whatever) has to be reversed, so in that case, put the whole thing in parenthesis and add a - symbol to the front of it (in front of the first parenthesis).

This should work.

But then again, I never did the tutorial so I don’t know the code.

---

<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:** [January 20, 2003, 10:24pm UTC](https://forum.kirupa.com/t/scroll-in-the-opposite-direction/11667/3 "2003-01-20T22:24:39Z")

</div>

hmmm, Im not sure I understand but here is the code, can you point it out?

onClipEvent (load)  
{  
xcenter=297.5;  
speed=.01;  
}  
onClipEvent (enterFrame)  
{  
var distance=\_root.\_xmouse+xcenter;  
\_x+=(distance_speed);  
}  
onClipEvent (enterFrame)  
{  
var distance=\_root.\_xmouse-xcenter;  
\_x+=(distance_speed);  
if (\_x \> 0) \_x=-590;  
if (\_x \< -595) \_x=0;  
}

---

<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:** [January 20, 2003, 10:27pm UTC](https://forum.kirupa.com/t/scroll-in-the-opposite-direction/11667/4 "2003-01-20T22:27:55Z")

</div>

Ok… well first you have to onClipEvent(enterFrames)… which makes no sense… so I will remove that.

```auto
onClipEvent (load)
{
xcenter=297.5;
speed=.01;
}
onClipEvent (enterFrame) {
var distance=_root._xmouse-xcenter;
_x+=(distance*speed);
if (_x > 0) _x=-590;
if (_x < -595) _x=0;
}

```

Now… do you see the line \_x += (distance\*speed); ??

Try change that to

\_x += -(distance\*speed);

Anything?

---

<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:** [January 20, 2003, 10:36pm UTC](https://forum.kirupa.com/t/scroll-in-the-opposite-direction/11667/5 "2003-01-20T22:36:16Z")

</div>

Hey lostinbeta, that worked thanks a lot !!

---

<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:** [January 20, 2003, 10:36pm UTC](https://forum.kirupa.com/t/scroll-in-the-opposite-direction/11667/6 "2003-01-20T22:36:47Z")

</div>

No problem 🙂
