This content has been marked as final.
Show 7 replies
-
1. Re: No Compile Time Checking for .as files?
jmryan Aug 15, 2007 1:29 PM (in response to Chekote)*.as files (and mxml files for that matter) are only checked if they are used. I.e. if you write a class but don't have any variables of that type, the file is never checked as it isn't compiled. Flex Builder only compiles classes that are needed for the application you are writing. So if you want the checking to work, make sure you've declared a variable of the class somewhere up the hierarchy.
This is the same reason why errors are not reported in the files until those files are saved, as a compile doesn't happen unless something is changed. -
2. Re: No Compile Time Checking for .as files?
Chekote Aug 15, 2007 1:55 PM (in response to Chekote)I am using the classes in my project, they are simply not being checked at compile time. If I use exactly the same files in a project in the Flash IDE, I get compile time errors as expected.
In regards to your second statement. I think you misunderstood what I meant. The Flex IDE gives real-time feedback on syntax errors etc when you are writing actionscript inside a script tag in mxml. It does *not* give any real-time feedback on syntax errors etc when you write actionscript in a *.as file.
The errors are not reported regardless of if changes to the file have been saved or not. -
3. Re: No Compile Time Checking for .as files?
Peter Flynn (Adobe)Aug 15, 2007 7:20 PM (in response to Chekote)
Hi Chekote,
If your AS class is not used anywhere in the application, it will get completely ignored by the compiler. Once a class is referenced in any way from your MXML code, it will get compiled and any errors or warnings will then be reported.
- Peter -
4. Re: No Compile Time Checking for .as files?
Peter Flynn (Adobe)Aug 15, 2007 7:30 PM (in response to Chekote)
Oops, sorry -- hadn't seen the other reply. Does this problem still occur after you do a clean (Project -> Clean)? If you have a project that consistently reproduces this problem, and is not too big, please file a bug and attach your project to the bug. You can do this at http://bugs.adobe.com/flex
As far as I am aware, Flex Builder doesn't give error feedback on AS code anywhere (AS file or MXML file) until you save your changes to the file.
- Peter -
5. No Compile Time Checking for .as files?
Chekote Aug 16, 2007 6:37 AM (in response to Chekote)It seems that jmryan was correct. I wasn't aware that when he said the classes had to be used, that he meant used in an mxml file, which they weren't. My classes were just referencing each other.
So if I am writing a large *.as framework for use in a Flex project, and I haven't referenced any of the classes in an mxml file yet, I'm not going to get any errors reported while I am working on the *.as files?
Surely Flex should check the validity of *.as files in a project, regardless of if they are used by an mxml file. By being in the project they are obviously of enough significance that the developer requires feedback on errors.
I could be creating a 100% *.as based API. It seems counter intuitive that I need to use an mxml file just to enable validation. I would obviously need an mxml file eventualy to test the API, but to *require* one just for validation really seems bizarre. -
6. Re: No Compile Time Checking for .as files?
Chekote Aug 23, 2007 6:14 AM (in response to Chekote)Well after a little more research, and as many people may already know, Flex Builder has an "Actionscript Project" that checks all *.as files in the project. So if I'm writing an *.as only API, then I should obviously use that instead.
I still believe all *.as files in a project should be checked regardless of their usage (or lack of).
Thanks for all the help guys. -
7. Re: No Compile Time Checking for .as files?
levancho Aug 23, 2007 6:41 AM (in response to Chekote)FYI. Same thing applies to Custom MXML files, if they are not used you can put anything you want in there and IDE will not give a error .