# cacheAsBitmap...ahhh

**URL:** <https://forum.kirupa.com/t/cacheasbitmap-ahhh/317571>\
**Category:** flash\
**Created:** [December 24, 2010, 10:39pm UTC](https://forum.kirupa.com/t/cacheasbitmap-ahhh/317571 "2010-12-24T22:39:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbo](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@tbo](https://forum.kirupa.com/u/tbo)\
**Post date:** [December 24, 2010, 10:39pm UTC](https://forum.kirupa.com/t/cacheasbitmap-ahhh/317571/1 "2010-12-24T22:39:01Z")

</div>

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.

```php

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
