when using cached bitmaps in mobile AIR apps.
In the AIR mobile profile, you can assign a Matrix object to
property of a display object.
When you set this property, you can apply any two-dimensional transformation
to the object without regenerating the cached bitmap. You can also
change the alpha property without regenerating the cached bitmap.
property must also be set to
the object must not have any 3D properties set.
the cached bitmap even if the display object is off screen, hidden
from view, or has its
property set to
property using a
matrix object that contains a different transform also regenerates
the cached bitmap.
The matrix transformation you apply to the
applied to the display object as it is rendered into the bitmap
cache. Thus, if the transform contains a 2x scale, the bitmap rendering
is twice the size of the vector rendering. The renderer applies
the inverse transformation to the cached bitmap so that the final
display looks the same. You can scale the cached bitmap to a smaller
size to reduce memory usage, possibly at the expense of rendering fidelity.
You can also scale the bitmap to a larger size to increase rendering
quality in some cases, at the expense of increased memory usage.
In general, though, use an identity matrix, which is a matrix that
applies no transformation, to avoid changes in appearance, as shown
in the following example:
displayObject.cacheAsBitMap = true;
displayObject.cacheAsBitmapMatrix = new Matrix();
property is set,
you can scale, skew, rotate, and translate the object without triggering
You can also change the alpha value within the range of 0 and
1. If you change the alpha value through the
with a color transform, the alpha used in the transform object must
be within 0 and 255. Changing the color transformation in any other
way regenerates the cached bitmap.
Always set the
whenever you set
content created for mobile devices. However, consider the following
potential drawback. After an object is rotated, scaled or skewed,
the final rendering can exhibit bitmap scaling or aliasing artifacts compared
to a normal vector rendering.