ActionScript 3.0 Tween and Fade Control Part II

Wed, Oct 28, 2009

ActionScript

ActionScript 3.0 Tween and Fade Control Part II

This movie requires Flash Player 9

No Timelines! With one single sentence we create a whole animation from ActionScript

Click Here for part II of this tutorial.
DOWNLOAD THE COMPLETE SOURCE FILE
Fade Control Final

CLICK HERE FOR A COMPLETE ACTIONSCRIPT 3.0 CARTOON SMART TUTORIAL

HERE IS THE SOURCE CODE!

//The ActionScript 3.0 Fade in and Fade Out
// solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE

// Let’s import Tweening Libraries
// This enables Tweeing Capabilities
import fl.transitions.Tween;
import fl.transitions.easing.* // This will import all
//easing capabilities

// Variables to hold the tween
var inTween:Tween;
var outTween:Tween;

//Now we will set the compiler
//to wait the buttons to be clicked
in_btn.addEventListener(MouseEvent.CLICK, fadeIn);
out_btn.addEventListener(MouseEvent.CLICK, fadeOut);
// Note the instance names have to be identical
// to the names we gave on stage

//Functions
//if any event listener has a function that is not declared
// a error message shows, even if the button is not clicked

function fadeIn(event:MouseEvent):void{

inTween = new Tween (sun_mc,”alpha”,None.easeNone,0,1,3,true);
// sun_mc is the instance name we gave on stage
// alpha is a string HAS to be in between quotes
// The opacitiy starts at 0 increasing all the way to 3, steady
// during 3 seconds
// the true is to state we are using seconds and not milliseconds
}

function fadeOut(event:MouseEvent):void{

inTween = new Tween (sun_mc,”alpha”,None.easeNone,1,0,3,true);
}

// Don’t forget to subscribe
//thanks for watching

Related Articles:

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

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