views:

33

answers:

2

I'm building an application in Actionscript using Flash assets, and my frame rate becomes very low (~7 fps) when I attempt to render 20+ assets on the screen, even though most of those assets are stopped movie clips. I've tried setting .cacheAsBitmap to true, which helps a bit, but not enough. What else can I do to get the frame rate up? I've noticed that some movie clips seem to impact it more than others, but I'm not sure how to alter them to make them easier to render.

Thanks!

A: 

It's hard to guess what could be causing the slowdown at such a small number of assets on screen, but the place to start would be to check for a memory leak, or excessive ram usage. To get a nice FPS / mem display while debugging your project, I recommend MrDoob's Stats

If that does not turn up any obvious culprits and you need to dig deeper, the best tool I've found (and use on all my own projects) is Grant Skinner's PerformanceTest

Mark L
A: 
  1. Go through Garbage Collection, use weak references on listeners.
  2. Profile your app for memory leaks, e.g. use FDT 4 Profiler to determine if it's leaking. Similar functionality is there in Flash Builder, see Using the profiler. An alternative open-source PBLabsProfiler was released just a week ago.

By the description, it looks like it's leaking.

Ain
Hi, thanks. I can definitely use the profiler to look for memory leaks (and yeah, I bet you're right about the leaks). If I fix those issues, should the frame rate improve? I was under the impression that fps had more to do with the graphics data being rendered at a given time. It also might be worth noting that fps is low as soon as I start the app.
LillyWolf