ActionScript 3.0 Video Tutorial: Motion Tween Methods, Resume, Stop, and Rewind

Wed, Nov 4, 2009

ActionScript

ActionScript 3.0 Video Tutorial: Motion Tween Methods, Resume, Stop, and Rewind

This movie requires Flash Player 9

It is extensive how many methods are there for controlling a motion tween on ActionScript.

See all possible tween methods here

In this 10 minutes, Music + Narration tutorial we show how to start, stop, resume and rewind a motion tween on ActionScript.

DOWNLOAD THE SOURCE FILE
Part 5 X Motion Final

CLICK HERE FOR A COMPLETE ACTIONSCRIPT 3.0 CARTOON SMART TUTORIAL

HERE IS THE SOURCE CODE!

//The ActionScript 3.0 Motion Tween Methods
// Avraham Saltoun
// solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE
// Let’s start by importing libraries
import fl.transitions.Tween;
import fl.transitions.easing.*;
// This will import all eases

var xTween : Tween;
// This is the variable that will hold the Tween
// in our case the “Tween” is the horizontal motion
// on stage

// This starts the animation on load
xTween = new Tween(boat_mc,”x”,None.easeNone, 10,450,7,true);

// boat_mc is the name of the symbol instance
// x is the tween type, this means horizontal movement
// none is the bounce and ease
// starts at coordinate 10 – that is the left side of the stage
//and finishes at 450, taking all together 7 seconds.
// the true states that we are counting seconds, not milliseconds…

// we have currently 3 buttons on stage
//Event Listeners – this will set the compiler
// waiting for button clicks
play_btn.addEventListener(MouseEvent.CLICK, playTween);
stop_btn.addEventListener(MouseEvent.CLICK, stopTween);
rewind_btn.addEventListener(MouseEvent.CLICK, rewindTween);

//Functions
//Play
function playTween (event:MouseEvent):void
{xTween.resume();}

//Stop
function stopTween (event:MouseEvent):void
{xTween.stop();}

//Rewind
function rewindTween (event:MouseEvent):void
{xTween.rewind();}

// This will stop the animation
// on the very beginning after it started
xTween.stop();

// Subscribe from the website!
// Thanks for watching….

Related Articles:

, , , , , , , , , , , ,

One Response to “ActionScript 3.0 Video Tutorial: Motion Tween Methods, Resume, Stop, and Rewind”


Trackbacks/Pingbacks

  1. [...] to add event listeners to Motion Tweens and we also show how the YoYo motion tween method works. CLICK HERE FOR THE FIRST PART OF THIS TUTORIAL DOWNLOAD THE SOURCE FILE: [...]

Leave a Reply

Security Code:

AVA Trading Forex
WIX create a FREE website.
Try ACT! 2010 Today
Accept Credit Cards
UseNeXT Fast Downloads
For Free Stuff Click Here

Get Paid for Filling Surveys


Go Daddy $7.49.com sale 125x125 Huddle Collaboration
oDesk Certified Action Script Programmer oDesk Certified Adobe Flash CS3 Designer oDesk Certified Adobe Photoshop 6.0 Designer

Compare Web Hosting Services and Prices

web hosting - Web Hosting guide to popular hosts.

Twitter Followers