opaqueBackground (MovieClip.opaqueBackground property)

public opaqueBackground : Number

The color of the movie clip's opaque (not transparent) background of the color specified by the number (an RGB hexadecimal value). If the value is null or undefined, there is no opaque background. For movie clips in which the cacheAsBitmap property is set to true, setting opaqueBackground can improve rendering performance.

You recognize a greater performance benefit with a movie clip that would have many transparent regions if opaqueBackground were not set.

Note:The opaque background region is not matched in a hitTest() method that has the shapeFlag parameter set to true.

Availability: ActionScript 1.0; Flash Player 8

Example

The following example creates a triangle outline and sets the opaqueBackground property to a specific color:

var triangle:MovieClip = this.createEmptyMovieClip("triangle", this.getNextHighestDepth());
triangle._x = triangle._y = 50;
triangle.lineStyle(3, 0xFFCC00);
triangle.lineTo(0, 30);
triangle.lineTo(50, 0);
triangle.lineTo(0, 0);
triangle.endFill();
triangle.opaqueBackground = 0xCCCCCC;

If your SWF file includes a version 2 component, use the version 2 components' DepthManager class instead of the MovieClip.getNextHighestDepth() method, which is used in this example.

See also

cacheAsBitmap (MovieClip.cacheAsBitmap property), hitTest (MovieClip.hitTest method)


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00001960.html