I’m using the Flash 9 AS3 Public Alpha IDE. I’m loading a suite of 256 external png images using the Loader class. There are multiple “suites” of these images, but once the .swf starts and a couple of settings are loaded, only one of the suites actually needs to be loaded for that session.
Only a small handful of these images are displayed at a time, but this handful changed rapidly. Images are quickly loaded, animated, unloaded, etc. Currently I’m using the Loader class to load the images whenever I need them and then I remove them from memory when I’m done. Because they are used so often, and without much forewarning before they become needed, this solution is no longer effective.
If I place all of these images in the Library and setup their linkage properties individually, everything works fast and efficient loading them with getDefinitionByName, but this is not practical to have to recompile my .swf file everytime the images change (not to mention setting up the linkage for 256 images is very tedious).
The other complication is that multiple classes that are not directly connected with each other need access to these images, which means the images need to have some sort of global access (like they with getDefinitionByName).
Any suggestions on the most effecient way to load all 256 images into memory and then give them global access to be quickly reproduced, duplicated, multiplied and animated by any class?