Categories
General

New improved cacheAsBitmap!

I’ve been working on a smart function that can convert a MovieClip into a bitmap so that it renders faster. “What’s wrong with the cacheAsBitmap property?” I hear you cry. Well much as it’s an amazing way to optimize the speed of moving clips, it can sometimes actually slow down render time!

It’s fine as long as you don’t resize or rotate your MovieClip. But as soon as you change the clip, the FlashPlayer has to re-create the bitmap cache.

So what I’ve done is make a bitmap and rotate and scale that instead. It’s not quite as good quality as when you do it with Vector graphics, but it’s so much faster it doesn’t matter.

And here’s an example:

[kml_flashembed movie=”/wp-content/uploads/manual/2006/bitmapcacheparticletest5.swf” width=”445″ height=”350″ FVERSION=”8″ SCALE=”noborder” /]

And yes it is AS2! 🙂

So I spent ages working on this code (matrix hell that you don’t want to know about), and I have a horrible feeling someone else beat me to it, so if anyone’s seen anything like this before let me know!

And I’ll be releasing this under a creative commons licence as soon as I get a spare moment, so keep an eye out :-).

3 replies on “New improved cacheAsBitmap!”

You might have some memory leaks on this one. I left for lunch came back and was working when I noticed my computer slow to a crawl. Looked at resource management and FireFox was 350MB of Memory. Closed your tab with the SWF and it went back to 60MB.

Other then that great stuff. Look forward to playing with it when the source is released.

Would love to see the source if you are still inclined.
(came here from the gskinner post)

ta.

I,

Your demo make me crazy, it’s unbeliveable !
Id’l like to see the AS 2.0 source code for learning purpose if possible ?

Thanks and best regards.
Ultral

Comments are closed.