1 Reply Latest reply on Jan 10, 2011 12:22 AM by Anirudh Sasikumar

    How to share classes between module and main app?

    Mogge 3000 Level 1



      I'm working on a application that uses modules and where each module has it's own project in Flash Builder. What is the best way for the modules to "know" about the classes in the main application? Should I extract all classes into a library project that both main app and modules can use? What are the options, what is considered best practise?





        • 1. Re: How to share classes between module and main app?
          Anirudh Sasikumar Adobe Employee



          You can have the application and modules in the same project. The advantage in this case is that Flash Builder automatically puts classes used by the application in the external path when compiling the module. (Flash Builder figures out which application (if any) a module is written for by the "Optimize for application" setting in Project properties -> Flex Modules -> Edit)


          Now if you want to put Modules in different projects, then make a common SWC and add the classes that you want to share with the Application to "Additional Compiler Arguments" using the extern compiler argument. (For more info see http://livedocs.adobe.com/flex/3/html/help.html?content=modular_4.html)


          P.S: You'll get better answers for this in the Flex General Discussions forum.




          1 person found this helpful