Bit of help with tween class please

Hiya

Building a basic website and getting a bit stumped on a bit of tween class i’m trying to incorporate. Basically i’ve got a fair bit of text i’m trying to keep on an internal page by just making each section a scrolling content box.

So there are 3 buttons at the top, each ‘scrolls’ onto a new section and I would like the ability for it to scroll back too, hence using the tween class to do this. I’ve managed to set it up and each button goes to each ‘page’ fine in reading order, so to speak (1, 2, 3), but if I got to 1, 2 then back to 1 it will start from 0 on the x axis.

Basically what i’m wanting to do is set the tween from the current _x value. So if I go 1, 2, then back to one, it will take the current _x value from 2, and scroll the opposite direction back to one.

I am using the following code on the buttons:

on (release){
    new mx.transitions.Tween(slider, _x, mx.transitions.easing.Regular.easeInOut, ._x, 50, .5, true);
}

Where _x is, i’m assuming is where I need the code for whatever is equal to x.

Any help much appreciated.:slight_smile:

Tom