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:

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

20 Responses to “ActionScript 3.0 Tween and Fade Control Part II”


Trackbacks/Pingbacks

Leave a Reply

You must be logged in to post a comment.

My name is Avraham Saltoun, and I live in Jerusalem, Middle East. I am currently on my mid  40's and I am a computer programming technician. Here you will find over one hundred quality video tutorials on Actionscript, and yes, I give online support for aspiring programmers, and pros as well, sharing screen on skype and delivering source code by email, click the button for live flash actionscript support now!

 
oDesk Certified Action Script Programmer
oDesk Certified Adobe Flash CS3 Designer
oDesk Certified Adobe Photoshop 6.0 Designer
Skype Me™!

$7.49 .Com! Score Savings Cartoon Smart Tutorials


1,260
Unique Visitors
Previous 30 Days
Powered By Google Analytics