I’ve got a bit of an issue…
We have an application that needs to load a varying amount of row graphics depending on user input. Currently, each row SWF is being loaded repeatedly using Flash.Display.Loader. The swf is rather large (17k) and loading 10 or so of them takes some time. Is there a way to only load this file one time and use it multiple times?
I am extremely new to Flash/actionscript. If there is any other info needed just let me know and I will try to provide it.
thanks.
Hey there, yes you can load it once; you can have all your assets in one SWF, and once loaded use them as it becomes necessary.
For example, let’s say you want to use two graphical rows (movie clips), rowA and rowB, on the SWF you have to load; this SWF will act as your asset library. What you have to do is create the rowA and rowB movie clips in your library and set them to be exported for Actionscript use. (On your FLA’s library, right-click on them and click on properties, and select Export for Actionscript, on the Class input field enter “rowA” for this example, and “rowB” respectively). Now that you have you assets on your library (they don’t have to on stage) publish the swf file.
Now, let’s move to the SWF where you’ll actually use this “library”. Here, you just need to load your SWF library (the one with the graphic assets) and you are good to go. Code example,
As you can see, once your asset library is loaded, you can use the assets whichever way you like. Anyway, hope this helps, and hopefully is what you were looking for.