atmd
atmd

Reputation: 7490

most effieciant way to run a flash animation/application for a long period of time

I need to run a flash animation, (swf file) for about 12 hours. This is for a exhibition.

Due to constraint outside of my control Im running this from a laptop (currently windows vista(!) but I can reinstall all but mac os's onto it, through a VGA, at a 1024x768 resolution.

Does anyone have any previus experience of best practices/advice on this?

would any os be better exquiped, am I better with a comandline linux running only a flash player? would there be any benifit converting the swf to native code and running it?

any pitfalls you can think of?

any advice greatly appriciated.

N.b I hve seen the question Running the Flash Player over long time period however I'm looking for best practices and tips etc on a wide range of topics

If anyone feels another 'overflow' would get me better advice please let me know

thanks for any suggestions

Andrew

EDIT:

just come across this: http://www.adobe.com/devnet/flash/articles/efficiency-tips.html Some good tips here on optimizing the file contents.

Upvotes: 1

Views: 293

Answers (2)

Strille
Strille

Reputation: 5781

Just some general tips:

  • Make sure you use the Release version of the Standalone Flash Player (the Debug version is slower and takes up more memory)
  • Always remove event listeners when you don't need them anymore, and just to be on the safe side use weak references when you add event listeners.
  • If you're loading .swf files into the main swf, make sure to call Loader.unloadAndStop() when you want to unload the .swf instead of Loader.unload().
  • In all classes you constantly create new instances of, you can spot memory leaks faster if you make sure each instance takes up a lot of memory. Just temporarily add a large bitmapData at the top of each class (private var _debugDummy : BitmapData = new BitmapData(2000, 2000);). Then you can quite quickly observe if the memory continously increases. Whatever you do don't forget to remove these dummies when you are done testing!

Specific tips in this case:

  • Build in the ability to run the time based logic at a faster rate, so you can simulate a "12h run" during a much shorter timespan. This will make it a lot easier to find leaks.
  • Since it's an exhibition, it might be a good idea to setup the computer to start the flash again if it crashes (or rather quits silently if it runs out of memory, which is the most common reason for it to quit unexpectedly). What we have done for exhibitions at the company I work is to create a projector file (.exe) from the release version of the flash player. Then we have a small service (built in-house) running on the machine which constantly checks that the projector .exe is running. If it's not, it starts it up again. As I said, the service is built in-house, but it's possible you can find something similar. Also, it might be a good idea to setup the computer to start the flash when the computer starts, in case the power is lost and the computer restarts. If it's an exhibition, you can't be paranoid enough :-)

Upvotes: 3

MickMalone1983
MickMalone1983

Reputation: 1054

Run it in standalone player, for both performance and reduced chance of errors.

If it's just a timeline animation, or something which uses no ActionScript, it should be compiled well enough that you can leave it to run.

If it's got any code in it, you need to make sure there aren't any leaks in it, and actually check this - 12 hours is certainly long enough for a significant leak to manifest itself!

What kind of thing is it you have running?

Upvotes: 3

Related Questions