0 Replies Latest reply on May 9, 2007 12:29 PM by derekdon

    Dynamic runtime shared libraries in Flash

    derekdon
      Runtime shared libraries in Flash only seem to work if there is a direct import link into the file that wishes to use the shared library item. Why can't the main swf dynamically load a shared.swf containing the shared library items into itself and therefore allow all child swf's that are loaded after that event to access the items? Or why can't you load the shared.swf containing the shared library items into the requesting file on the fly and grant access to the items from the requesting file that way? Creating direct import links to shared libraries in all child flash documents is very annoying in larger applications!

      Ideally it should work like this...


      1. All cross domain security issues have been dealt with.
      2. I have a main container.swf.
      3. The main container loads a remote shared library swf that contains the shared library items.
      4. After the load, the main container loads swf files that will need to access shared library items.
      5. One of the loaded child swf's contains a TextField with a style sheet attached. We need to have access to a shared font from the shared.swf library to enable us to set embedFonts to true and to have the TextField render correctly. Unless the import link to the shared library was created manually within the child swf containing the TextField, the TextField will not render the text with the embedFonts set to true.

        This also seems to be the case when dynamically attaching shared move clips with linkage id's to the stage. Unless a direct import link to the shared library was created within the requesting file or should I say the file that is running the script, the script fails. It seems that libraries are kept isolated from one another, probably to stop linkage id confliction etc. the same way as the _global scope isn't shared between swf's originating from different domains.

        Using something like, libraryName.linkageID could combat this, but I need to know if I'm wasting my time...


      I hope this makes sense. There wasn't a solution last time I checked, but it's been awhile and I was hoping someone out there has come up with a solution at this stage or even knows the official word on the subject.

      Is this possible Adobe!

      Cheers,

      Derek.