Compiling with unused and unavailable classes (like StageText on web)
I have a common codebase which I am using to export for mobile
(iOS+Android) desktop (OSX+Windows) and web (SWF)
99% of the code is compatible everywhere, and it just works
However, there are a couple instances (like StageText), where it won't
work. In those cases, I want to use a different class (like TextField or
TLFTextField). Logically, this is fine... however it won't compile
I have something like-
var myStageText:StageText;
var myRegularText:TextField;
if(isAIR) {
myStageText = new StageText();
} else {
myRegularText = new TextField();
}
How can I let this compile everywhere, without turning off error checking?
No comments:
Post a Comment