Is it possible to write code in a Flex application that will only be run in a debug build, or when running through the debugger? Does Flex provide a way to actually remove code entirely from release builds, like C-style #defines?
The app is not necessarily running in a web page.
You can do conditional compilation like this:
And then add this to the compiler flags:
for debug builds, and
for release builds.
CONFIGanddebuggingcan be anything, likeMY_AWESOME_NAMESPACEandfooBar, it doesn’t matter.Read more here: Using conditional compilation.