gotoAndPlay Scene after Tween Class finish?

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!!!

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

When I do that, this is what I get…

The property being referenced does not have the static attribute.

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

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]

… 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=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.

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 :slight_smile: