cacheAsBitmap is a property that’s a good idea to set to true for display objects that will be moved around containing vector content. flashPlayer has to redraw vectors that are transformed and this hurts performance. by setting cacheAsBitmap to true you’re effectively converting the vector to a bitmap which flashPlayer can move round alot easier. this will work great if all you’re doing is moving it on the x and y but if you want to scale, rotate or change the alpha, cacheAsBitmap will make performace worse as it will have to redraw the vector, apply the transformation and cache it as a bitmap all over again. there is a nice extra available at the moment only for Air on mobile devices called cacheAsBitmapMatrix. this setting will allow scale, rotation and alpha transformations without flash player needing to redraw the vector..
var box : Sprite = new Sprite();
box.graphics.beginFill(0x009900);
box.graphics.drawRect(0, 0, 50, 50);
box.graphics.endFill();
addChild(box);
box.cacheAsBitmapMatrix = box.transform.concatenatedMatrix;
box.cacheAsBitmap = true;
// now move, scale, rotate and change the alpha of box much more efficiently on mobile devices
note: cacheAsBitmap and cacheAsBitmapMatrix are only for displayObjects that do not have nested animation. this will require flash player to redraw on each frame the contents on the displayObject that changed