Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Check out this class <a href="http://blog.another-d-mention.ro/programming/how-to-identify-at-runtime-if-swf-is-in-debug-or-release-mode-build/" rel="noreferrer">http://blog.another-d-mention.ro/programming/how-to-identify-at-runtime-if-swf-is-in-debug-or-release-mode-build/</a></p> <p>This class provides two pertinent (and different) pieces of information:</p> <ul> <li>Was the SWF built with the -debug switch (has debug symbols compiled in)?</li> <li>Is the Flash player a debug player (has the ability to display errors, etc)?</li> </ul> <p>The Capabilities.isDebugger only answers the second question - is the user running the Flash Debug player. In your case, to gate portions of your application on a debug build, you want the -debug build check (and then don't deliver -debug builds into production).</p> <p>Note however, that both these checks are runtime checks. Using conditional compilation (aka CONFIG::debug) around your debug code is still a good idea, as it will ensure that possibly sensitive debug code is NOT delivered in the final SWF, making it as small and secure as possible.</p> <p>I'm reproducing the referenced code here, in case the blog link ever goes down:</p> <pre><code>package org.adm.runtime { import flash.system.Capabilities; public class ModeCheck { /** * Returns true if the user is running the app on a Debug Flash Player. * Uses the Capabilities class **/ public static function isDebugPlayer() : Boolean { return Capabilities.isDebugger; } /** * Returns true if the swf is built in debug mode **/ public static function isDebugBuild() : Boolean { var stackTrace:String = new Error().getStackTrace(); return (stackTrace &amp;&amp; stackTrace.search(/:[0-9]+]$/m) &gt; -1); } /** * Returns true if the swf is built in release mode **/ public static function isReleaseBuild() : Boolean { return !isDebugBuild(); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload