[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
Solved

# I am trying to get the tweens to execute one after the other.

Posted on 2011-10-13
Medium Priority
171 Views
Hello,

I am trying to get the tweens to execute one after the other. Only the first tween is executing, I can't figure out what I am doing wrong.Any ideas.

1) I have named the instance 'rectangle'
Thanks,

Ben

``````import fl.transitions.easing.*;
import fl.transitions.Tween;
import fl.transitions.TweenEvent;

var twFade : Tween;
var twStretch : Tween;
var twEnlarge : Tween;

twFade = new Tween(rectangle,"alpha",Strong.easeOut,1,0,3,true);

function mynext1(e : TweenEvent):void {

twStretch = new Tween(rectangle,"x",None.easeOut,0,100,3,true);
}

function mynext2(e : TweenEvent):void{

twEnlarge = new Tween(rectangle,"height",Strong.easeOut,rectangle.height,rectangle.height+100,3,true);
twStretch.removeEventListener(TweenEvent.MOTION_FINISH,mynext2);

}
``````
0
Question by:AivsCoder

LVL 39

Accepted Solution

blue-genie earned 500 total points
ID: 36964086
Hey Ben.
Your code works - but you probably can't see it happening because in the first tween you've made your rectangle invisible.
:-)
to prove it just change the first alpha to

twFade = new Tween(rectangle,"alpha",Strong.easeOut,1,0.5,3,true);

twFade = new Tween(rectangle,"alpha",Strong.easeOut,1,0,3,true);

ie. change alpha from 1 to 0.5 instead of 1 to 0
0

Author Closing Comment

ID: 36974955
thanks heaps
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
###### Suggested Courses
Course of the Month17 days, 14 hours left to enroll

#### 831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.