# Gotoandplay when tween finished problem

**URL:** https://forum.kirupa.com/t/gotoandplay-when-tween-finished-problem/267848
**Category:** flash
**Created:** [August 6, 2008, 1:24pm UTC](https://forum.kirupa.com/t/gotoandplay-when-tween-finished-problem/267848 "2008-08-06T13:24:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Pale\_September](https://avatars.discourse-cdn.com/v4/letter/p/73ab20/32.png) [@Pale\_September](https://forum.kirupa.com/u/Pale_September)
#### Post date: [August 6, 2008, 1:24pm UTC](https://forum.kirupa.com/t/gotoandplay-when-tween-finished-problem/267848/1 "2008-08-06T13:24:31Z")

</div>

I am trying to duplicate an effect used on a template gallery that I have for my photo website. (I want to have bigger images so am re-writing myself).  
I am able to achieve the effect I want using the tween class. My problem is that after the tween has finished I want the movie to move to a particular frame ( or even the next frame if specifying a frame isn’t possible).  
This is my actionscript code but when the tween has finished, it doesn’t move to the next frame.  
Could some kind person tell me where I am going wrong.  
Thank you.

```auto
// Import the Tween class and the easing package
import mx.transitions.Tween; 
import mx.transitions.easing.*; 

// Global variables
var scaleTo = 500; // We will scale the image to 500%

stop();
// add the onPress handler to the movieclip
	btn_inv1.onPress = doTween;

// Do the scaling tween on the MovieClip
function doTween(){
var yScaleT:Tween = new Tween(my_mc, "_xscale", Strong.easeOut, 5, scaleTo, 5, true); 
var yScaleT:Tween = new Tween(my_mc, "_yscale", Strong.easeOut, 5, scaleTo, 5, true); 

var yScaleT:Tween = new Tween(my_mc, "_x", Strong.easeOut, my_mc._x, 30, 5, true); 
var yScaleT:Tween = new Tween(my_mc, "_y", Strong.easeOut, my_mc._y, 120, 5, true); 

};

yScaleT.onMotionFinished = function() {
	 this.nextFrame();
};

```
