# Tween class and onMotionFinished script

**URL:** https://forum.kirupa.com/t/tween-class-and-onmotionfinished-script/220600
**Category:** Uncategorized
**Created:** [March 27, 2007, 5:36pm UTC](https://forum.kirupa.com/t/tween-class-and-onmotionfinished-script/220600 "2007-03-27T17:36:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tannermorrow](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@tannermorrow](https://forum.kirupa.com/u/tannermorrow)
#### Post date: [March 27, 2007, 5:36pm UTC](https://forum.kirupa.com/t/tween-class-and-onmotionfinished-script/220600/1 "2007-03-27T17:36:41Z")

</div>

hey guys.

here’s my script:

**import mx.transitions.Tween;**  
**import mx.transitions.easing.\*;**

**preview.onRollOver = function() {**  
**var xscTweenOver:Tween = new Tween(this, “\_xscale”, Elastic.easeOut, this.\_xscale, 1000, 1, true);**  
\*\*var yscTweenOver:Tween = new Tween(this, “\_yscale”, Elastic.easeOut, this.\_yscale, 1000, 1, true); \*\*  
**}};**

**preview.onRollOut = function() {**  
**var xscTweenOver:Tween = new Tween(this, “\_xscale”, Elastic.easeOut, this.\_xscale, 100, 1, true);**  
**var yscTweenOver:Tween = new Tween(this, “\_yscale”, Elastic.easeOut, this.\_yscale, 100, 1, true);**  
**};**

fairly simple. but here’s what i’d really like to do. i want the first tween to execute **(\_xscale)** and then after that is finished execute the **(\_yscale)** tween. i’ve thought about using **onMotionFinished** …but am not exactly sure how to go about getting it to work correctly. any AS junkies care to help? :thumb2:
