# Reverse the direction of the scroller?

**URL:** <https://forum.kirupa.com/t/reverse-the-direction-of-the-scroller/264159>\
**Category:** flash\
**Created:** [June 23, 2008, 4:45pm UTC](https://forum.kirupa.com/t/reverse-the-direction-of-the-scroller/264159 "2008-06-23T16:45:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wdv](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wdv](https://forum.kirupa.com/u/wdv)\
**Post date:** [June 23, 2008, 4:45pm UTC](https://forum.kirupa.com/t/reverse-the-direction-of-the-scroller/264159/1 "2008-06-23T16:45:36Z")

</div>

var center = Stage.width/2;  
var speed = .05;  
function activateMenu() {  
menu.onEnterFrame = function() {  
var distance = \_root.\_xmouse-center;  
if (mask.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
this.\_x += (distance\*speed);  
if (this.\_x\<-sub\_menu.\_width/2) {  
this.\_x = 0;  
}  
if (this.\_x\>0) {  
this.\_x = -sub\_menu.\_width/2;  
}  
}  
};  
}

---

<div class="post-metadata">

**Author:** ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)\
**Post date:** [June 23, 2008, 5:28pm UTC](https://forum.kirupa.com/t/reverse-the-direction-of-the-scroller/264159/2 "2008-06-23T17:28:25Z")

</div>

you expect anyone to look through all that code?  
man…this looks like you dont even know where the scroll function is

---

<div class="post-metadata">

**Author:** ![wdv](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wdv](https://forum.kirupa.com/u/wdv)\
**Post date:** [June 23, 2008, 5:55pm UTC](https://forum.kirupa.com/t/reverse-the-direction-of-the-scroller/264159/3 "2008-06-23T17:55:19Z")

</div>

is that better?

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 23, 2008, 6:29pm UTC](https://forum.kirupa.com/t/reverse-the-direction-of-the-scroller/264159/4 "2008-06-23T18:29:27Z")

</div>

at a glance it looks OK

what is it doing wrong? is it scrolling one way then stopping?

some times chopping up code and getting working separate from the rest of your code helps

---

<div class="post-metadata">

**Author:** ![wdv](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wdv](https://forum.kirupa.com/u/wdv)\
**Post date:** [June 23, 2008, 7:06pm UTC](https://forum.kirupa.com/t/reverse-the-direction-of-the-scroller/264159/5 "2008-06-23T19:06:34Z")

</div>

when i hover the cursor to the right the images scroll to the left when i need it to scroll to the right

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 23, 2008, 7:14pm UTC](https://forum.kirupa.com/t/reverse-the-direction-of-the-scroller/264159/6 "2008-06-23T19:14:41Z")

</div>

there is a tut on this on the main page (unless you have looked there)

also on [gotoandlearn.com](http://gotoandlearn.com) for the carousels, it takes you through this on screen in video format

at a guess

this\_x += is incorrect

should be

this.\_x = this.\_x+(other stuff)

---

<div class="post-metadata">

**Author:** ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)\
**Post date:** [June 24, 2008, 4:06pm UTC](https://forum.kirupa.com/t/reverse-the-direction-of-the-scroller/264159/7 "2008-06-24T16:06:44Z")

</div>

maybe that happens because the content height aind bigger than the stage! …

set the motion to false if it aind bigger then the stage?
