Hello all this is my first post here.

I am trying to create a simple panorama viewer. the direction is governed by two mouse over areas one on each side of the stage (both will be invisible), at present the left side animates the background panorama right by 10 and the right side animates the panorama left by -10.

This essentially means it multiplies its speed if i mouse over the same edge twice, this is a problem i wish to fix, i also notice that if i go from one edge of the screen to the other it animates and stops, if we look at this from a maths point of view.

-10 moves left ( if mouse moves too right mouse over edge) +10 this = 0 value or in other words stops animation, then i have to mouse over again to +10 to make value 10 eg move right. this mouse over twice thing is not what i want.

To fix both issues, i think it would be best to place a mouse over area between both left and right that zeros out the value. so the middle will always stop the animation. though id not know how to zero out the value.

here take a look at my code so far



scroll_L.addEventListener(MouseEvent.MOUSE_OVER, f2_MouseOverHandler_2);

function f2_MouseOverHandler_2(event:MouseEvent):void
{
bg_mc.addEventListener(Event.ENTER_FRAME, f2_AnimateHorizontally_3);

function f2_AnimateHorizontally_3(event:Event)
{
bg_mc.x += -10;
}
}



Scroll_R.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler_4);

function fl_MouseOverHandler_4(event:MouseEvent):void
{
bg_mc.addEventListener(Event.ENTER_FRAME, fl_AnimateHorizontally_4);

function fl_AnimateHorizontally_4(event:Event)
{
bg_mc.x += 10;
}
}





I hope this all makes sense.