Skip to main content
Known Participant
October 29, 2009
Answered

Improving performance with overlapping MCs?

  • October 29, 2009
  • 1 reply
  • 771 views

I'm having some performance issues in certain areas of a flash game Im making.

Here's the situation:

I have big movieclip containing a map that can be scrolled and scaled. There are some pannels with a bunch of MC buttons, controls, etc. on the right side of the stage. These are seperate from the map and stay in the same place.

Everything runs fine untill the large map is  zoomed in and/or scrolled such that the right side buttons and stuff are overlapping them map. Then the framerate jumps down from a nice smooth 30 fps to about 3 fps while the map is moving. There are no issues with the map moving when they don't overlap.

Now the thing is, is that's there's no real interaction between the buttons and the map. No transparency or anything, in fact I'm perfectly happy with the map dissapearing behind a side pannel. There are only about 3 pannels that the screen drawing routine would have to worry about, as all the buttons rest on top of the pannels, so why is my performance taking such a hit?

(Hmmm. Actually I do have a lot of transparency, but each is on top of a solid background, and none interact with the map.)

This topic has been closed for replies.
Correct answer kglad

when not scaling (or fading or rotating etc), enable the cacheAsBitmap property of your movieclips.  disable while scaling (etc).

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
October 29, 2009

when not scaling (or fading or rotating etc), enable the cacheAsBitmap property of your movieclips.  disable while scaling (etc).

Desprez10Author
Known Participant
October 30, 2009

Ok, I orginally thought this was going to work, but it's not.

At first, for some reason it caused all my buttons to cut holes into the panel clip that holds the buttons. Apparently, it was effectively removing them, thus speeding up the frame rate. I don't know why it was removing the buttons, but I suspected something was wonky with the buttons' internal transparency. I re-did them and removed the transparency and it fixed the buttons, but the cacheing as not increased the frame rate at all.

kglad
Community Expert
Community Expert
October 30, 2009

make sure you're only enabling that property for movieclips that benefit from it WHILE they benefit and disable that property when it hinders performance.  you should read about cacheAsBitmap to see when to enable and when to disable.