Skip navigation
Currently Being Moderated

Several alchemy libraries in one swf?

Mar 15, 2011 12:00 AM


Hello!

 

I've sucessfuly compiled several c/c++ libraries into SWC libraries which I plan to use in my flex project. But I'm wondering is it beter to keep them as separate libraries or make one big glue.gg file with all interop code for all of this libraries?

 
Replies
  • Currently Being Moderated
    May 9, 2011 8:33 AM   in reply to andrey.mironov

    I went for the single .gg file.  I had blow-ups whenever I tried using two .gg-generated swc libraries in one swf.

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2011 9:13 AM   in reply to audioMirror

    Because Alchemy uses statics to keep track of its ram, etc, you sort of can't have more than one instance.  The libraries would be sharing the same ram, which can cause problems.

     

    However, you can dodge the issue by loading your alchemy libraries into separate Application Domains.  I'm doing this in my project:

     

    1. Compile your libs as SWCs
    2. Extract the SWFs from inside the SWCs
    3. Embed the library SWFs in your application
    4. Use Loader.loadBytes to load your library into its own Application Domain

     

    The other benefit of doing it this way is that if your alchemy lib crashes it won't affect any other alchemy libraries because they're using entirely separate ByteArrays for ram, etc.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points