Our Flash project has the following structure. Two FLA files with graphical assets (symbols), imported into a pure AS3 code project using SWCs.
There are some symbols that are used in both ui.fla and login.fla, so we'd like to put them in a shared library, like so.
The catch is that we don't want to use shared.fla's symbols in e.g. ui.fla's code, but in the authoring environment, so that we can drag symbols from shared.fla into ui.fla's symbols (without copying). Is this possible?
Sharing assets can be possible via Remote Shared Library
(RSL).
But please, be careful: I haven't seen this way in production, it was only my experiments some years ago.
Here is an example:
Export for ActionScript
& Export in frame 1
, type the name of symbolExport for runtime sharing
. Type the name of that swf: 'shared_lib.swf'OK
Publish
it to SWF and SWCSo, now we have our library. Lets create some asset, that will use it
Library
exported symbol, CTRL + C
(or right click, copy)Library
. At this step, we have shared_lib.swf
, shared_lib.swc
and mainui.swc
. In out mainui
we can work with external asset as well. You can create another assets in the same way.
Lets talk about project settings, that will use our assets.
So, what we have exactly at the moment? Mainui.swc
has the symbol, that contains another 'virtual' symbol. If you just try to load mainui.swf
in browser with some profiler, you'll see, that at first it loads mainui.swf
, then it loads shared_lib.swf
.
But if you try to create some project and include mainui.swc
, you'll get the error with undefined symbol, because all that have mainui - is just virtual reference to symbol from shared_lib.
To resolve it, you must completely include shared_lib.swc
in your project. In this case, you'll have:
mainui.swc
shared_lib.swc
Now, it will work.
Hope, it will be helpful.