0
votes

so I'm trying to publish a looping animation in Flash with a large amount of image sequences in it. (around 3000 frames all told). And I'm having problems with the swf using too much memory when it's played.

The swf is about 80mb, but the file uses an excess of 2gb of ram when played. I don't know why that would be. A memory leak?

My understanding is: that Flash will just load all images in a swf into memory unless you dump the memory somehow.Can anyone explain how to do this? Is it possible? I can't seem to find a solution online.

Thanks

2
just a random thought: would it be better if you combined the 3000 frames in to a video and played that instead?mitim
It's going to be 100% browser width. I like how the smooth dynamic scaling works in swfs. I will do that as a last resort, but the image does degrade pretty badly when scaled this way. It looks pretty nasty (well the way that I know how to do it anyhow)Emile
Could you please add some code? It is required to find the leak.Florian Lavorel
Thanks for your response. I've not added any code apart from goToAndPlay(s). It's all timeline animation.Emile

2 Answers

1
votes

SWF file keeps all images in a compressed format. They can be compressed very well but when playing, they must be decompressed so they take much bigger memory space.

How to optimize that depends on you. There is also a possibility that it cannot be optimized - for example, if SWF does automatic decompression of all images on load. You can test it by checking the free memory after swf is loaded but before the animation is accessed. If standard timeline animation takes too much memory, you can try to use your own custom animation. For example, in an ENTER_FRAME loop you can create only one instance of image for the current frame, and all past instances will be removed and garbage collected. Hard to say because a testing is needed.

0
votes

Thanks for your responses. As I couldn't find an answer to this, I've resorted to using external video. Cheers for your time.