3 Replies Latest reply on May 17, 2010 11:25 PM by fransfx

    Is there a compile type check for .as files?


      It seems there is no compile support for the .as files. I made a typo, typing HttpService, instead of HTTPService, in one of my .as files, but suprisingly, Flash Builder does not flag it at all. I have enabled "Build automatically", so I assumed that if there are any errors, Flash Builder should flag it. I also have tried to clean the project and force build the project manually, but still it does not show any compile error problems.  See screenshot below:




      On the other hand, if I made the error in .mxml file, Flash Builder correctly flag it as error.

      Please see the screenshot below:




      I want to have compile type check when working on .as files too. Is there any way I can enable that?



        • 1. Re: Is there a compile type check for .as files?
          fransfx Level 1

          It seems that only when the Actionscript class is referenced from the mxml, then the compile-time check is run on the class. For example, if I try to instantiate the class Foo below from the main mxml, only then the error "type was not found"  for HttpService is shown. If the class is in the project, but the class is not referenced or instantiated anywhere from the mxml, then there is no compile-time check on the class. Is that true? If it is true, it is very impractical though because I might just create a Actionscript class without using it anywhere, and I still want compile-time check is run on that class.


          Can someone please help me or clarify my understanding?



          • 2. Re: Is there a compile type check for .as files?
            Jason San Jose Adobe Employee

            Your findings are correct. The compiler is limited to showing compiler errors in the context of a compilation unit (application, module, etc.).


            Jason San Jose

            Software Engineer, Flash Builder

            • 3. Re: Is there a compile type check for .as files?
              fransfx Level 1

              Ok, I can live with this. Coming from Java background, I found this "feature" confusing though. In Java, all classes in the Eclipse project, no matter whether the classes are actually used or not, will be compile-time checked. Hopefully in future release this could be fixed?