In this flash ActionScript tutorial a fade effect is created in ActionScript using the ALPHA property to control opacity and is controlled by an if statement. The tutorial has GOLDFINGER Instrumental as background music.
DOWNLOAD THIS TUTORIAL TO YOUR HARD DRIVE
DOWNLOAD THE SOURCE FILE
HERE IS THE SOURCE CODE
/*
Controlling a Fade Effect in Actionscript
Using a fade statement
by Avraham Saltoun
solutions at say-web dot com
This script is FREE
to use and distribute.
There are no copyrights attached. */
Logo_mc.alpha = 0;
/* The alpha controls opacity
the property has a maximum of 1
this will set the movie clip invisible! */
Logo_mc.addEventListener(Event.ENTER_FRAME, FadeIN);
function FadeIN(e:Event):void
{
Logo_mc.alpha=Logo_mc.alpha +0.05;
trace (Logo_mc.alpha);
//the trace will tell
//the alpha value every time
// we have an event …
if (Logo_mc.alpha >= 1)
{
Logo_mc.alpha=1;
Logo_mc.removeEventListener(Event.ENTER_FRAME,FadeIN);
}
//Thanks for watching !!!
}






7 Responses to “ActionScript 3.0 Lesson 14: Create a Fade Effect and Control it with the If Statement”
Trackbacks/Pingbacks