We have a very large SWF hosted in a website which is just a repository of hundreds of movies/symbols. We load this SWF at the beginning with the Loader class but then the client will access a very few of them at that moment.
Is it possible to tell the loader to download symbols only when they’re needed? (as with applicationDomain.getDefinition(…)).
Thanks in advance.
Don’t think so, you might need to load the whole swf before using getDefinition().
A workaround I can think of is splitting the swf into many different ones.
Either naming the swf’s by the class they contain, or storing some swf filename/contained classes pairs in a text file/xml and using that to load resources by name.
Have a look at BulkLoader, it could save you some time.
If you’re using the Flash IDE, I wrote a simple jsfl script that should make things
less tedious:
All it does is loops thought the library items, and for the symbols that are exported for actionscript, it exports a swf file(where the Class name is used as a filename), and generates a bulk-loader snippet.
Easiest way to get it into Flash is this:
File (File > New > Flash
JavaScript File)
default to the Commands folder,
which means you could use it through
the Commands menu. You can also
set a keyboard shortcut, if needed.
The generated code might not be perfect, but it gives you an idea, and it should be readable enough for easy tweaks.
HTH,
George