AB-D
AB-D

Reputation: 11

How can I reduce memory (RAM) usage in an AIR Flash app with 1,000s of assets?

I'm packaging an Adobe Air app for iOS and Android and my (RAM) memory usage is over 100MB. I have a very large number of assets in my game (RPG). It seems that the quantity/size of assets directly effects memory usage. The memory usage is present before any items are declared or instantiated. I can make a blank project with no Action Script and the memory usage is still over 100MB based on the number/size of assets in my library.

I'm looking for a way to package my app so that every single asset isn't loaded into memory when the game launches. I've tried packing my assets into a SWC and importing that into my project (using the "merged into code" option) and the results are the same.

1) Is there a way to bundle a SWC so that its contents are no immediately loaded into memory?

2) Are there any other methods I can try so that my app doesn't immediately load the assets into memory?

I can't optimize my audio assets (the largest contributor to the issue) any further. It is a music game and I can't really go below 128kbps MP3.

Flash Pro CS6 - Action Script 3 - Adobe Air 3.3

Upvotes: 0

Views: 1054

Answers (1)

Daniel MesSer
Daniel MesSer

Reputation: 1181

As far as I know, you can't load swc files during runtime. You can on the other hand load SWF files during runtime.

So, you separate your assets into multiple SWF files then load the ones you need when appropriate. If you want to create items from the loaded SWF file's library you will use ApplicationDomain and getDefinition.

Upvotes: 1

Related Questions