Skip to main content
Inspiring
January 8, 2014
Answered

cacheAsBitmap on nested movieclips/sprites?

  • January 8, 2014
  • 1 reply
  • 671 views

Hi. Regarding cacheAsBitmap, I was wondering whether to appy 'cacheAsBitmap' property on every nested sprites/movieclips or only on the main sprite/movieclip? In my case, I've one main container sprite, which has 3-4 sprites. These 3-4 sprites may also have children (shape/sprites). Now, I'm using scrollRect property of main container to scroll. I've set 'cacheAsBitmap' property to true for every single child/sub-child of the main container and of course to the main container as well. So, my question is, do I need to set for main container only or for every single child -it may have?

This topic has been closed for replies.
Correct answer moccamaximum

for main container only

if the nested sprites have animations themselves, then cacheAsBitmap is not a good choice:

http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e35.html

1 reply

moccamaximumCorrect answer
Inspiring
January 8, 2014

for main container only

if the nested sprites have animations themselves, then cacheAsBitmap is not a good choice:

http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e35.html

Inspiring
January 9, 2014

Thanks for the correct reply and the link. This helped me a lot in understanding cacheAsBitmap property.

Edit:

After reading that post (link above), I think I'm doing wrong by setting cacheAsBitmap property to true for all nested children. It only consumes more memory! (Correct me if I'm wrong)