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:
- Create document, that will contain shared assets. Let it have names 'shared_lib'
- Create some symbol. Prepare it for RSL:
- In Flash IDE choose Library->your symbol(right click)->Properties...
- Select
Export for ActionScript
& Export in frame 1
, type the name of symbol
- Select
Export for runtime sharing
. Type the name of that swf: 'shared_lib.swf'
OK
Publish
it to SWF and SWC
So, now we have our library. Lets create some asset, that will use it
- Create another document, lets call it 'mainui'.
- Return to the 'shared_lib', select in
Library
exported symbol, CTRL + C
(or right click, copy)
- Return to just created 'mainui', paste to
Library
.
- Create some other symbol, export it for ActionScript and place our imported symbol into it
- Compile it, export to SWC, SWF.
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:
- via library-path directive: optionaly included
mainui.swc
- via include-libraries directive: completely included
shared_lib.swc
Now, it will work.
Hope, it will be helpful.