2
votes

Our Flash project has the following structure. Two FLA files with graphical assets (symbols), imported into a pure AS3 code project using SWCs.

enter image description here

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.

enter image description here

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?

1

1 Answers

2
votes

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:

  1. Create document, that will contain shared assets. Let it have names 'shared_lib'
  2. 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

  1. Create another document, lets call it 'mainui'.
  2. Return to the 'shared_lib', select in Library exported symbol, CTRL + C (or right click, copy)
  3. Return to just created 'mainui', paste to Library.
  4. Create some other symbol, export it for ActionScript and place our imported symbol into it
  5. 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.