# Reverse Direction of Scrolling Panel

**URL:** <https://forum.kirupa.com/t/reverse-direction-of-scrolling-panel/315360>\
**Category:** flash\
**Created:** [October 24, 2010, 5:37am UTC](https://forum.kirupa.com/t/reverse-direction-of-scrolling-panel/315360 "2010-10-24T05:37:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xPINKMERCEDESx](https://avatars.discourse-cdn.com/v4/letter/x/73ab20/32.png) [@xPINKMERCEDESx](https://forum.kirupa.com/u/xPINKMERCEDESx)\
**Post date:** [October 24, 2010, 5:37am UTC](https://forum.kirupa.com/t/reverse-direction-of-scrolling-panel/315360/1 "2010-10-24T05:37:39Z")

</div>

Hello guys, haven’t been here in a while.  
But I have a simple problem I think.

I have a moving panel of images, and I want to be able to change the direction of the panel with the click of a button. Here’s what I have so far:

var panelSpeed:Number = 1;  
var leftDirection:int = -1;  
var rightDirection:int = +1;  
var panelDirection:\*;

stage.addEventListener(Event.ENTER\_FRAME,scrollPanel,false,0,true);

scrollLeft.addEventListener(MouseEvent.CLICK,moveLeft);  
scrollRight.addEventListener(MouseEvent.CLICK,moveRight);

function scrollPanel (event:Event):void  
{  
panel.x -= panelSpeed;  
}

function moveLeft (event:MouseEvent):void  
{  
//panelDirection = ???;  
}

function moveRight (event:MouseEvent):void  
{  
//panelDirection = ???;  
}

As of now this panel is scrolling to the left, and I would like the option to have it scroll to the right on the click of a button. Right now I’m stuck guys. Thanks a bunch for any guidance.

Pink
