开发者

Can I access compile flags from within ActionScript 2/3?

Is it possib开发者_JAVA技巧le to access compile time flags (in specifics: the allow debugging flag) in ActionScript?

If so, how can I do this?


I'm not sure if you can access the -debug flag directly. What I usually do when compiling with mxmlc is add a custom parameter which is available in ActionScript.

Add this to the parameters you use with mxmlc -define=CONFIG::debug,true and in the ActionScript code you can just go ahead and write something like this:

if(CONFIG::debug) {
    // -- DO SOME STUFF IF WE'RE DEBUGGING
}

With this technique you can add a bunch of custom conditional compilation parameters if you want. In addition, anything left inside the CONFIG::debug block will not actually be compiled into the SWF if you set CONFIG::debug, false

Here's a good start http://www.boostworthy.com/blog/?p=227 and here's the Adobe Flex 3 doc on the subject: http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_21.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜