Sign in to follow this  
chibitotoro0_0

[web] AS3 addChild MovieClip limit

Recommended Posts

chibitotoro0_0    122
Hi everyone, I've been trying to make a waterbrush simulator in AS3. I'm doing so by using blurred circles and drawing them where the mouse is. I'm adding a movieclip to everywhere the mouse is but it seems to bog down around 600 movieclips(sprites). I have my scene set at 120fps which significantly drops around 600 movieclips. I've tried grouping sprites with similar attributes into a parent movieclip and applying transforms to the parent but I get not significant speedups. I've set cacheAsBitmap =true for both the individual circles and the parent movieclip. In Flash it ultimately crashes at ~3000 movieclips. When I run it outside in the standalone flash player it goes much higher but same thing happens after 600 movieclips.... it lags! I was wonder if anyone knows of another way to do this or if there is an upper limit to how many sprites flash can actually support. Thanks for any input. ---------- other stats: XNA - point sprites 55000 units run at 60fps with my current hardware. of course this is 3D accelerated and flash is not.

Share this post


Link to post
Share on other sites
Kaze    948
copy pasted from a few threads down

Quote:
Original post by jbadams
I'd say you're probably in for a bit of work rewriting if your performance is suffering that badly.

I get the impression from what you've said that you're using movieclip objects? Have you looked into using the method described here:
Quote:
from CopyPixel is faster then Sprites? [demo flash file]
The performance is so much better and uses less code that it makes me sad. In short, I have arrow objects in memory to represent every arrow. In the render loop (onEnterFrame event) I update their positions/status and create new ones as needed. Once that's done, I create a new BitmapData, loop over all the arrows and use copyPixels from my sprite sheet onto the correct position of the new BitmapData. Finally, I take the new BitmapData, convert it to a bitmap and replace the old bitmap with the new one. That's it. No tricks for performance or anything and it flys.
More from the same author here. Essentially it boils down to a more 'traditional' blitting style of rendering rather than using movieclip or graphic objects.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this