Fade in and fade out
You can achieve a fade in and fade out effect using the _alpha property of movie clips. We can create ActionScript that fades objects automatically or acts in response to an event like a button click. To create the effect, we'll need to know how the fade should occur as well as which direction the fade will occur - fade in or fade out.
Open the starter file fader.fla. You can see the ball instance on the Stage. We’ll fade this in and out.
Select the instance and open the Actions panel with the F9 shortcut key. Add the following code.
onClipEvent(load) {
var alphaDirection = "out";
var changeRate = 5;
}