Skip to main content
Inspiring
December 18, 2012
Question

Load bitmaps from CS5

  • December 18, 2012
  • 1 reply
  • 420 views

Hi,

trying to improve my program's performances I read a lot of different posts and tutorial in internet.

One of the most recommended things to do is "use bitmaps". Use that class is not a problem in as3, but I don't know which class should I use in Flash CS5. Should I always use "Graphic"?

So far I'm creating my images as Graphic and load them as the class I need (sprite in order to be displayobject container or bitmap).

Thanks!

This topic has been closed for replies.

1 reply

Colin Holgate
Inspiring
December 18, 2012

In CS5 you can select any movieclips on the stage and in the Properties panel, under Display, you can check the box that says "Cache as bitmap". That will be enough to make the vectors in the movieclip be handled as a bitmap. It's also possible to do that using AS3 at runtime, by setting the movie clip's cacheAsBitmap to true.

If you intend to scale or rotate the movieclip, and you're using the render mode "GPU", you will also need to set the mc.cacheAsBitmapMatrix value using AS3. Like this (where "mc" is a movieclip on the stage):

mc.cacheAsBitmapMatrix = new Matrix();

Here's an article about the two properties:

http://www.republicofcode.com/tutorials/flash/as3cacheasbitmap/

In the article they show a cute technique, of taking the movieclip's existing matrix as the starting point, rather than using a new Matrix.

If, with all of these tricks, you find that things are still not smooth enough, you may need to think about updating Flash, and using a later version of AIR.