Copy link to clipboard
Copied
I installed Flash Builder 4.7 on my windows xp machine, and tried to migrate projects from FB 4.6. However in one of my projects I use conditional compiling, but I'm getting errors.For example in FB 4.6 I have this sample code:
public class MyClass{
CONFIG::DEBUGGING{
import com.package.SomeClassOnlyForDebugging
}
function someFunction():void{
if (CONFIG::DEBUGGING){
SomeClassOnlyForDebugging.create();
}
}
}
When I compiled it in FB 4.6 everything worked fine. However when I try to compile it in FB 4.7, then I get error on the conditional compiling only inside the function and not on the import statement. The only way I have found to overpass it is to go to Project>Properties>ActionScript Compiler and disable Enable strict type checking. But this is not a permanent solution.
Am I doing something wrong, or is there some other way to do it?
Copy link to clipboard
Copied
You should to do like that:
function someFunction():void
{
CONFIG::DEBUGGING {
SomeClassOnlyForDebugging.create();
}
}
without if.
Copy link to clipboard
Copied
Yes this solves the problem, but I'm loosing my ability to use if,else conditionals. Should I report it as a bug, or the whole scheme of if,else has been dropped?
Copy link to clipboard
Copied
I would like an answer to this question as well. Having good conditional compilation support is a handy tool to write optimized code.