2 Replies Latest reply on Mar 11, 2007 7:44 PM by doug777

    How do I make a class available to any of my projects?

    doug777 Level 1
      I have written a simple function to delete trailing zeros when displaying percentages. The class extends the Number Formatter class.

      How or where and in what package do I place this class, if I want to be able to use it anywhere in any of my Projects?

      Doug
        • 1. Re: How do I make a class available to any of my projects?
          peterent Level 2
          You need to create a Flex Library project. This type of project's result is SWC file whereas a Flex application project's result is SWF.

          So let's say your formatter is in the package my.library.formatter and it is called ZeroFormatter. So it will be in the folder my/library/formatter. With that folder in your Flex project you'll find a SWC in your project's bin directory.

          Now you can use that in any other project. In other Flex application project, edit the Project Properties and select the Build path and select the Libraries tab. Pick Add SWC and browse to the SWC you just made and pick the Add button.

          Now you use import my.library.formatter.ZeroFormatter and use the ZeroFormatter class.
          • 2. Re: How do I make a class available to any of my projects?
            doug777 Level 1
            That's great. Thanks so much for your help.

            Doug