# Tween Class

**URL:** <https://forum.kirupa.com/t/tween-class/296519>\
**Category:** Uncategorized\
**Created:** [September 16, 2009, 1:25am UTC](https://forum.kirupa.com/t/tween-class/296519 "2009-09-16T01:25:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackOD](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@jackOD](https://forum.kirupa.com/u/jackOD)\
**Post date:** [September 16, 2009, 1:25am UTC](https://forum.kirupa.com/t/tween-class/296519/1 "2009-09-16T01:25:08Z")

</div>

Hello,  
i am experimenting with the tween class and i have it set up so when i click a button the object moves onto the stage and i want it so that when i click the same button again it moves further off the stage as to create a gallery by having a long movie clip moving up and exposing more images,

here is my code

///////

btn\_click.addEventListener(MouseEvent.CLICK, onClick);  
import fl.transitions.Tween;  
import fl.transitions.easing.\*;

function onClick(Event:MouseEvent):void  
{  
var myTween:Tween = new Tween(myObject, “x”, Elastic.easeOut, 0, 300, 5, true);

}  
stop();

///////

this code above moves the object to the centre of the screen but i have previously used this method (below) without the tween, i tried combining the two but iv had no luck

btn\_2.addEventListener(MouseEvent.CLICK, onClick2);

function onClick2(event:MouseEvent):void  
{  
image\_1.x += 800;  
}

////////
