Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm making a 2D game where the map will be scrolled frequently, and only a small part of it will be visible at any time.

Which implementation would run faster?

  • The naive way: Make the map a single huge MovieClip and move it around.
  • The elegant way: Split the map into
    multiple chunks and use a frustum
    culling algorithm to render only the ones that are visible.

Now that I think of it, this question boils down to whether Flash does its own frustum culling on big MovieClips.

share|improve this question
Couldn't you could just try it both ways, profile it, and use the faster one? – BigSandwich Sep 19 '10 at 3:59
I was hoping I wouldn't have to... – jSepia Sep 20 '10 at 11:01
up vote 6 down vote accepted

Flash is actually pretty good at handling "frustum culling". You should use the scrollRect property for this:

If you plan to use a Image for your world map, you should be aware of the Bitmap-size limitations of the Flash player. If you target player 9, the limits are 2880x2880 pixels. Player 10 and up can handle images with a pixel sum of max. 4095^2 pixels (see:

If you think your map might exceed these limits, I think it would be a good idea to implement some tiling on your own.

Update: Here's an article that explains scrollRect a bit better:

share|improve this answer
Thanks for the last link about scrollRect. This sentence in particular answered my question: "Vector masks are very inefficient in Flash, because the whole DisplayObject is rendered, not just the visible portion." – jSepia Sep 20 '10 at 9:52

Spend time implementing culling now. You'll be happy you did.

Should you choose not to, at least avoid making it a MovieClip as there's no technical reason it shouldn't be anything more than a Sprite instance.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.