Saturday, July 19, 2008

Debugging Tip

At times you might find yourself wanting to know if your swf is running in a debug version of Flash and behave accordingly. You can do this by making use of the fact that Error class's getStackTrace() returns null when running in non-debug version of Flash player.

function isDebugPlayer( ) : Boolean
{
return Boolean(new Error().getStackTrace());
}

No comments:

Post a Comment