开发者

Flex "Debug Only" Code?

开发者 https://www.devze.com 2023-03-22 20:00 出处:网络
Is there a way to mark certain parts of code so that they don\'t ev开发者_如何转开发en get compiled in release mode? I know you can do it in C# with syntax like this:

Is there a way to mark certain parts of code so that they don't ev开发者_如何转开发en get compiled in release mode? I know you can do it in C# with syntax like this:

if #DEBUG
    trace("Debug");
else
    trace("Release");

Does Actionscript/Flex have any similar feature?


Yes, you can use:

CONFIG::debugging { 
    trace("Debug"); 
}
CONFIG::release { 
    trace("Release"); 
}

using the following compiler arguments:

-define+=CONFIG::debugging,true -define+=CONFIG::release,false

More details is here.

0

精彩评论

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