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

Posted on 2011-10-13
Last Modified: 2012-05-12

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'


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);

Open in new window

Question by:AivsCoder
    LVL 39

    Accepted Solution

    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);

    instead of

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

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

    Author Closing Comment

    thanks heaps

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Does Flash have a Firefox problem? 5 306
    Accessing Live Dynamic Stream 6 170
    blocked plugin flash 5 101
    Play RTMP without Flash 3 155
    I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
    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…
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

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

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

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now