# Bit of help with tween class please

**URL:** <https://forum.kirupa.com/t/bit-of-help-with-tween-class-please/223343>\
**Category:** Uncategorized\
**Created:** [April 21, 2007, 3:22pm UTC](https://forum.kirupa.com/t/bit-of-help-with-tween-class-please/223343 "2007-04-21T15:22:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomto](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@tomto](https://forum.kirupa.com/u/tomto)\
**Post date:** [April 21, 2007, 3:22pm UTC](https://forum.kirupa.com/t/bit-of-help-with-tween-class-please/223343/1 "2007-04-21T15:22:54Z")

</div>

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:

```auto
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.🙂

Tom
