
846
ActionScript classes
cacheAsBitmap (MovieClip.cacheAsBitmap
property)
public cacheAsBitmap : Boolean
If set to
true
, Flash Player caches an internal bitmap representation of the movie clip. This
can increase performance for movie clips that contain complex vector content.
All vector data for a movie clip that has a cached bitmap is drawn to the bitmap instead of to
the main Stage. The bitmap is then copied to the main Stage as unstretched, unrotated pixels
snapped to the nearest pixel boundaries. Pixels are mapped one to one with the parent object.
If the bounds of the bitmap change, the bitmap is recreated instead of being stretched.
No internal bitmap is created unless the
cacheAsBitmap
property is set to
true
.
After you set a movie clip's
cacheAsBitmap
property to
true
, the rendering does not change,
however the movie clip performs pixel snapping automatically. The animation speed can be
significantly faster, depending on the complexity of the vector content.
The
cacheAsBitmap
property is automatically set to
true
whenever you apply a filter to a
movie clip (when its
filter
array is not empty). If a movie clip has a filter applied to it,
cacheAsBitmap
is reported as
true
for that movie clip, even if you set the property to
false
.
If you clear all filters for a movie clip, the
cacheAsBitmap
setting changes to what it was last
set
to.
In the following cases a movie clip does not use a bitmap even if the
cacheAsBitmap
property
is set to
true
, and instead renders the movie clip from vector data:
■
The bitmap is too large: greater than 2880 pixels in either direction.
■
The bitmap fails to allocate memory (due to an out of memory error).
The
cacheAsBitmap
property is best used with movie clips that have mostly static content
and that do not scale and rotate frequently. With such movie clips,
cacheAsBitmap
can lead
to performance increases when the movie clip is translated (when its
x
and
y
position is
changed).
Availability:
ActionScript 1.0; Flash Player 8
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...