How to use Motion Tween in ActionScript 3.0

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

var at:Array = new Array();

at.push(new Tween(stageitem, ‘x’,Strong.easeIn,0, 500,2,true ));
//Here
// Instance Name of Movie Clip is (stageitem)
// 0 = Start Frame
// 500 = End Frame
// 2 = Time Duration

at[0].addEventListener(TweenEvent.MOTION_FINISH, done);

function done(e:Event)
{
at[0].yoyo();
}

View Demo

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s