Quantunet.com

My Account

Joins Us
Flash 8 Actionscript 2.0 QuickSkills
Simple Alpha Tween  

Download this .fla

How to create this alpha tween.

Actionscript
onClipEvent (enterFrame) {
this._alpha -= 3;
}




Note:
Press the "refresh" button in the browser to play the animation again.

As the Actionscript is put inside the mc, "this" refers the the mc on the timeline the code is in So by association references the the mc "mc1" as it is inside it.

 

onClipEvent(enterFrame){
this._alpha -= 3;
}

 

The code " _alpha -=3; " subtracts 3 percent from the alpha value  of the movie clip.

as this is inside the "onClipEvent(enterFrame)" function it is called every time the animation enters a new frame.

So the code as a whole tells the movie clip it is inside reduce the alpha percentage by 3 percent every time the animation enters a new frame causing it to eventually disappear.

Question

Given the fact the this animation runs at 12 frames per second. How much time will it take for the mc to fully disappear


© 2008 Quantunet LLC All Rights Reserved | Intellectual Property | Terms of Use | Privacy
Home | About Quantunet | FAQ's | Contact Us