1 Reply Latest reply on Apr 14, 2008 7:15 AM by peterent

    Multiple files

    easypzmaths Level 1
      I would like to keep the Class definition and constructor in one file and the functions called by the constructor in another file. How can I do that?
        • 1. Re: Multiple files
          peterent Level 2
          There isn't a way to do this. If you have an MXML file you can use the <mx:Script source="whatever.as" /> tag to include code from another file, but for a pure class definition ActionScript file, it is not possible.

          I also think it is unwise. First, you would lose the Flex Builder code parsing, code hinting and outlining which can make navigating your class files easier. Second, it would turn into a maintenance nightmare. Imagine you had 2 files for every class and had dozens of classes. If you had to ask someone to look at your code it would be very difficult and frustrating to open the class file and then to open additional files to look at the code; those additional files would not have import statements to help identify the origins of the classes.

          Just my opinion.