I'd really like to see where this thread goes because efficiency in Flash is
a touch subject I guess.
First suggestion I have is stop using MovieClips. They're kinda useless.
Move as far down the chain as possible... to bitmapData and shapes. The
simpler you go and the more low level stuff you write, the better it gets.
We wrote an animated bitmap class for a flash game we wrote, and we got more
than 5000 of them running without a problem (in the world, not on screen).
The display list and event listeners are two other places that chew up a lot
of power. I've been tempted many a time to eliminate the display list
entirely and do everything rendered to a bitmapData and then display that -
not sure if it would make a difference but it would be a fun experiment, and
a telling one.
Hope this helped... its two cents from a designer and part time coder, so
don't trust it too much!

Cheers,

Ashim

2008/9/2 Beach Boy <[EMAIL PROTECTED]>

> We have a huge movieclip of 5000 by 5000 pixels with different
> (transparant)
> layers.
> We can make an instance of the movieclip and work with it, we can move
> layers, scale them, ...
>
> But as soon as we add the MovieClip to the stage the ram memory-usage jumps
> to 200 MB!
> My guess is that flash retrieves all the bitmapdata from the MovieClip (all
> 25 million pixels) so it can display it. And all this data takes up around
> 200MB.
>
> For cpu performance and obviously the memory-issue we use bitmapdata with
> clipRect to extract a single 'screenshot' of 600 by 400 and add that to the
> stage instead of the entire mc. At first the memory-usage is reasonable,
> but
> as we start to explore the map it goes up again. It keeps rising to the
> point that, when you have explored the entire map, the memory-usage is back
> at around 200MB, same as when we added the mc to the stage.
>
> We use BitmapData.dispose() but this doens't seem to help either as the
> garbage-collector doesn't free up the ram instantly.
> We tried using tiles, we cut the entire mc up in tiles and added and
> removed
> the necessary tiles, but again, the memory starts low and rises as we
> explore the map.
>
> It's hard to believe that all those papervision-applications run so
> smoothly
> using BitmapData while we only use a couple large jpg's and have such
> extreme memory-usage.
> Is there any way to make the garbage-collector pass (we use flash player 9)
> or reduce the memory-usage?
>
> Any help or tips would be greatly appreciated!
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
The Random Lines
My online portfolio
www.therandomlines.com
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to