<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>ADM Blog &#187; debug</title> <atom:link href="http://blog.another-d-mention.ro/tag/debug/feed/" rel="self" type="application/rss+xml" /><link>http://blog.another-d-mention.ro</link> <description>No matter how you see things, reality changes when you reach understanding</description> <lastBuildDate>Fri, 22 Jul 2011 06:56:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1</generator> <item><title>Handy CSS Debug Snippet</title><link>http://blog.another-d-mention.ro/programming/handy-css-debug-snippet/</link> <comments>http://blog.another-d-mention.ro/programming/handy-css-debug-snippet/#comments</comments> <pubDate>Mon, 27 Jul 2009 10:46:21 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[debug]]></category> <category><![CDATA[html]]></category> <guid
isPermaLink="false">http://blog.another-d-mention.ro/?p=530</guid> <description><![CDATA[Great little debuging snippet found while browsing. The code adds different coloured borders to the assets depending on its level. Leave commented out if not needed. 1 2 3 4 5 6 7 8 * &#123; outline: 2px dotted red &#125; * * &#123; outline: 2px dotted green &#125; * * * &#123; outline: 2px [...]
Related posts:<ol><li><a
href='http://blog.another-d-mention.ro/programming/how-to-identify-at-runtime-if-swf-is-in-debug-or-release-mode-build/' rel='bookmark' title='Permanent Link: How to identify at runtime if the swf is in debug or release mode/build'>How to identify at runtime if the swf is in debug or release mode/build</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Great little debuging snippet found <a
href="http://homepage.mac.com/chrispage/iblog/C42511381/E20060806095030/index.html">while browsing</a>. The code adds different coloured borders to the assets depending on its level. Leave commented out if not needed.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td
class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span> <span style="color: #993333;">dotted</span> <span style="color: #993333;">red</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span> <span style="color: #993333;">dotted</span> <span style="color: #993333;">green</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span> <span style="color: #993333;">dotted</span> orange <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span> <span style="color: #993333;">dotted</span> <span style="color: #000000; font-weight: bold;">blue</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">red</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">green</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> orange <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #000000; font-weight: bold;">blue</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>Related posts:<ol><li><a
href='http://blog.another-d-mention.ro/programming/how-to-identify-at-runtime-if-swf-is-in-debug-or-release-mode-build/' rel='bookmark' title='Permanent Link: How to identify at runtime if the swf is in debug or release mode/build'>How to identify at runtime if the swf is in debug or release mode/build</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://blog.another-d-mention.ro/programming/handy-css-debug-snippet/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to identify at runtime if the swf is in debug or release mode/build</title><link>http://blog.another-d-mention.ro/programming/how-to-identify-at-runtime-if-swf-is-in-debug-or-release-mode-build/</link> <comments>http://blog.another-d-mention.ro/programming/how-to-identify-at-runtime-if-swf-is-in-debug-or-release-mode-build/#comments</comments> <pubDate>Tue, 07 Jul 2009 11:43:37 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[Flex / ActionScript]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[actionscript]]></category> <category><![CDATA[as3]]></category> <category><![CDATA[debug]]></category> <category><![CDATA[flex]]></category> <category><![CDATA[release]]></category> <guid
isPermaLink="false">http://blog.another-d-mention.ro/?p=513</guid> <description><![CDATA[It may be interesting to know at runtime whether an application is running from a debug or release SWF file. It allows the application to automatically execute debug specific code when the file is a debug SWF file and ignore this code when it is published as a release file. Also, it should be nice [...]
Related posts:<ol><li><a
href='http://blog.another-d-mention.ro/programming/how-to-clone-duplicate-an-object-in-actionscript-3/' rel='bookmark' title='Permanent Link: How to clone (duplicate) an object in ActionScript 3'>How to clone (duplicate) an object in ActionScript 3</a></li><li><a
href='http://blog.another-d-mention.ro/programming/java-script/read-data-directly-from-base64-without-decoding/' rel='bookmark' title='Permanent Link: Read data directly from base64 without decoding'>Read data directly from base64 without decoding</a></li><li><a
href='http://blog.another-d-mention.ro/programming/create-professional-flex-components/' rel='bookmark' title='Permanent Link: Create professional Flex components'>Create professional Flex components</a></li></ol>]]></description> <content:encoded><![CDATA[<p>It may be interesting to know at runtime whether an application is running from a debug or release SWF file. It allows the application to automatically execute debug specific code when the file is a debug SWF file and ignore this code when it is published as a release file. Also, it should be nice to know if you have a debug flash player just for the same reasons. But for the last one, there is a function in the Capabilities class called isDebugger.</p><p>One solution would be to use <a
href="http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_21.html" target="_blank">conditional compilation</a>. The other solution is in the following code (hack).</p><div
class="wp_syntax"><div
class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> org<span style="color: #000066; font-weight: bold;">.</span>adm<span style="color: #000066; font-weight: bold;">.</span>runtime
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.system</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">Capabilities</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> ModeCheck
	<span style="color: #000000;">&#123;</span>
		<span style="color: #3f5fbf;">/**
		 * Returns true if the user is running the app on a Debug Flash Player.
		 * Uses the Capabilities class
		 **/</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> isDebugPlayer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">Boolean</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #004993;">Capabilities</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">isDebugger</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Returns true if the swf is built in debug mode
		 **/</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> isDebugBuild<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">Boolean</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Error</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">getStackTrace</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">search</span><span style="color: #000000;">&#40;</span><span style="color: #009966; font-style: italic;">/:[0-9]+]$/m</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">&gt;</span> <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Returns true if the swf is built in release mode
		 **/</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> isReleaseBuild<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">Boolean</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">!</span>isDebugBuild<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div><p>This code simply searches for line numbers of errors in StackTrace result. Only StackTrace result of a debug SWF file contains line numbers. Then we know that we are running a debug or release SWF file.</p><p>This class is also available in the <a
href="http://blog.another-d-mention.ro/downloads/components-pack/">Components Pack</a> at Runtime subpackage</p><p>Related posts:<ol><li><a
href='http://blog.another-d-mention.ro/programming/how-to-clone-duplicate-an-object-in-actionscript-3/' rel='bookmark' title='Permanent Link: How to clone (duplicate) an object in ActionScript 3'>How to clone (duplicate) an object in ActionScript 3</a></li><li><a
href='http://blog.another-d-mention.ro/programming/java-script/read-data-directly-from-base64-without-decoding/' rel='bookmark' title='Permanent Link: Read data directly from base64 without decoding'>Read data directly from base64 without decoding</a></li><li><a
href='http://blog.another-d-mention.ro/programming/create-professional-flex-components/' rel='bookmark' title='Permanent Link: Create professional Flex components'>Create professional Flex components</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://blog.another-d-mention.ro/programming/how-to-identify-at-runtime-if-swf-is-in-debug-or-release-mode-build/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> </channel> </rss>
