ActionScript 3.0 Lesson 14: Create a Fade Effect and Control it with the If Statement

Fri, Aug 14, 2009

ActionScript


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 !!!

}

Related Articles:

, , , , , , , , , ,

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


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