This is one simple thing can never get right. I can’t seem to cache things correctly ever.
I’m using my phone, with GPU rendering.
var container:MovieClip= new MovieClip();
for (var i:uint=0; i<50; i++)
{
var myMc:Item= new Item(); // movieclip
myMc.x = Math.random() * 600;
myMc.y = Math.random() * 600;
//myMc.cacheAsBitmap=true;
//myMc.cacheAsBitmapMatrix= new Matrix();
container.addChild(myMc);
}
addChild(container);
addEventListener(Event.ENTER_FRAME,go);
function go(e:Event)
{
container.x--;
}
So i dump 50 instances of my movieclip into container, and move the container. (results show no difference whether i am moving the container or not)
Any way i do it, caching those movie clips does not result in performance boost, it’s the same, or in some cases caching was actually slightly worse frame rate. I get the same results if the movieClip is a drawn line, or an image containing transparency.
Am i doing something wrong here?
(In my real project, other things move in the container, so its not like i can just cache the container)
Question 2:
Why does the regular movieclip perform so well? There must be some internal caching going on? If i place images on each frame of a movieclip and just change frame# at run time, It’s perfect, no lag at all.
So 1 movieclip to contain my static images and when i need one i call that 1 mc with the correct frame number. This is fine, but the images don’t change, isn’t this exactly the time when you would want to cache as a bitmap?
-thanks