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