11.2. Applying Transparency to Movie Clips
Problem
You want to adjust the transparency of a movie clip.
Solution
Select the movie clip instance during authoring time and adjust the Alpha Color value in the Property inspector.
Alternatively, you can modify the transparency at runtime using ActionScript to set the movie clip’s _alpha property.
Discussion
By adjusting the alpha (transparency) value of a movie clip instance, you affect the appearance of the transparency of all the contents of that instance. The valid alpha range is from 0% (completely transparent) to 100% (completely opaque), and the default value for all new movie clip instances is 100%. Notice, however, that the alpha value applied to a movie clip instance is multiplied by the alpha values of each of the nested contents to yield the resulting transparencies. For example, if you apply a 50% alpha value to a movie clip instance, and that instance contains two nested movie clips—one with 100% alpha and the other with 50% alpha—the result is that the first nested movie clip displays at 50% alpha (which is 50% of 100%) and the second nested movie clip displays at 25% alpha (which is 50% of 50%).
One way to modify a movie clip instance’s transparency is at authoring time. The advantage of adjusting a movie clip instance’s alpha value at authoring time is that you can accomplish this task without having to use any ActionScript. The process is as follows:
Select the movie clip instance on the stage.
Locate the Color Styles menu in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access