Task: Fading Movie Clip
If you can set a movie clip's transparency value, it follows that you can gradually change that value to make it appear as if the movie clip is fading away. Here's how to do it:
Start with a new Flash movie.
Create a simple movie clip. Any simple shape will do.
Attach the following movie clip script:
onClipEvent(enterFrame) { if (this._alpha > 0) { this._alpha -= 5; } }
This script uses an if statement to determine whether the _alpha value is not yet at 0. It starts at 100 and then decreases by 5 area frames. If it is 0, it fails the if statement, and the _alpha property no longer decreases.
The example movie 07fadeaway.fla contains this script. Give it a try.