# gotoAndPlay Scene after Tween Class finish?

**URL:** https://forum.kirupa.com/t/gotoandplay-scene-after-tween-class-finish/261957
**Category:** flash
**Created:** [June 2, 2008, 5:07am UTC](https://forum.kirupa.com/t/gotoandplay-scene-after-tween-class-finish/261957 "2008-06-02T05:07:07Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![DavidAmosPhoto](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@DavidAmosPhoto](https://forum.kirupa.com/u/DavidAmosPhoto)
#### Post date: [June 2, 2008, 5:07am UTC](https://forum.kirupa.com/t/gotoandplay-scene-after-tween-class-finish/261957/1 "2008-06-02T05:07:07Z")

</div>

Can any one help me… I have spent many hours trying to nut this one out…

I have an animated button which I am animating using a tween class. It works fine, my problem is this, I need to jump to another Scene after the animation has finished.

HOW please!!!

---

<div class="post-metadata">

### Author: ![Macsy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/macsy/32/3238_2.png) [@Macsy](https://forum.kirupa.com/u/Macsy)
#### Post date: [June 2, 2008, 5:14am UTC](https://forum.kirupa.com/t/gotoandplay-scene-after-tween-class-finish/261957/2 "2008-06-02T05:14:02Z")

</div>

First. dont use scence,  
Secound, check tween class on kirupa tut pages,  
Third, check [AS]Tween.onMotionFinnished = function (){gotoAndPlay()}[/AS]

---

<div class="post-metadata">

### Author: ![DavidAmosPhoto](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@DavidAmosPhoto](https://forum.kirupa.com/u/DavidAmosPhoto)
#### Post date: [June 2, 2008, 5:34am UTC](https://forum.kirupa.com/t/gotoandplay-scene-after-tween-class-finish/261957/3 "2008-06-02T05:34:11Z")

</div>

When I do that, this is what I get…

The property being referenced does not have the static attribute.

---

<div class="post-metadata">

### Author: ![Macsy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/macsy/32/3238_2.png) [@Macsy](https://forum.kirupa.com/u/Macsy)
#### Post date: [June 2, 2008, 5:39am UTC](https://forum.kirupa.com/t/gotoandplay-scene-after-tween-class-finish/261957/4 "2008-06-02T05:39:24Z")

</div>

what did you write then ?  
Tween referece to whatever you call your tween ofcourse

---

<div class="post-metadata">

### Author: ![DavidAmosPhoto](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@DavidAmosPhoto](https://forum.kirupa.com/u/DavidAmosPhoto)
#### Post date: [June 2, 2008, 5:43am UTC](https://forum.kirupa.com/t/gotoandplay-scene-after-tween-class-finish/261957/5 "2008-06-02T05:43:18Z")

</div>

Ok, here is what I have in the code…

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

new Tween(clip4_mc,"_y",Elastic.easeOut,-43.6,250.5,5,true);

```

Tween.onMotionFinished = function() {  
gotoAndPlay(“Scene 2”,1);  
}

[QUOTE=Macsy;2334601]what did you write then ?  
Tween referece to whatever you call your tween ofcourse[/QUOTE]

---

<div class="post-metadata">

### Author: ![Macsy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/macsy/32/3238_2.png) [@Macsy](https://forum.kirupa.com/u/Macsy)
#### Post date: [June 2, 2008, 6:13am UTC](https://forum.kirupa.com/t/gotoandplay-scene-after-tween-class-finish/261957/6 "2008-06-02T06:13:43Z")

</div>

… you should really check tutorials before posting, or before anything, really…  
[AS]

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

var \*\*\*\*:Tween = new Tween(clip4\_mc,"\_y",Elastic.easeOut,-43.6,250.5,5,true);

\*\*\*\*.onMotionFinished = function() {  
gotoAndPlay(“Scene 2”,1);  
}

[AS]

---

<div class="post-metadata">

### Author: ![DavidAmosPhoto](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@DavidAmosPhoto](https://forum.kirupa.com/u/DavidAmosPhoto)
#### Post date: [June 2, 2008, 6:29am UTC](https://forum.kirupa.com/t/gotoandplay-scene-after-tween-class-finish/261957/7 "2008-06-02T06:29:34Z")

</div>

[QUOTE=Macsy;2334635]… you should really check tutorials before posting, or before anything, really…  
[AS]

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

var \*\*\*\*:Tween = new Tween(clip4\_mc,"\_y",Elastic.easeOut,-43.6,250.5,5,true);

\*\*\*\*.onMotionFinished = function() {  
gotoAndPlay(“Scene 2”,1);  
}

[AS][/QUOTE]

Thank you VERY MUCH Macsy… I actually worked it out before your last post. Yes I set up a var and it works beautifully… Thanks again for your time. I have been searching and trying different codes since 9am this morning.

---

<div class="post-metadata">

### Author: ![akalah](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@akalah](https://forum.kirupa.com/u/akalah)
#### Post date: [June 2, 2008, 12:57pm UTC](https://forum.kirupa.com/t/gotoandplay-scene-after-tween-class-finish/261957/8 "2008-06-02T12:57:02Z")

</div>

another creative solution I’ve used is to set up a interval that will go off after your tween finishes. It’s bulkier but it works too 🙂
