<?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>*drawlogic &#187; DEBUGGING</title>
	<atom:link href="http://drawlogic.com/category/debugging/feed/" rel="self" type="application/rss+xml" />
	<link>http://drawlogic.com</link>
	<description>interactive and game development technologies for the web - flash, flex, unity3d, silverlight, javascript</description>
	<lastBuildDate>Thu, 17 May 2012 13:12:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>AS3 Papervision 3D Debugging/Stats with PV3DDebug</title>
		<link>http://drawlogic.com/2008/09/24/as3-papervision-3d-debuggingstats-with-pv3ddebug/</link>
		<comments>http://drawlogic.com/2008/09/24/as3-papervision-3d-debuggingstats-with-pv3ddebug/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 11:36:04 +0000</pubDate>
		<dc:creator>drawk</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[3D ENGINES]]></category>
		<category><![CDATA[ACTIONSCRIPT]]></category>
		<category><![CDATA[ACTIONSCRIPT3]]></category>
		<category><![CDATA[ARCHITECT]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[BENCHMARK]]></category>
		<category><![CDATA[DEBUGGING]]></category>
		<category><![CDATA[DEVELOPMENT]]></category>
		<category><![CDATA[FLASH]]></category>
		<category><![CDATA[FLEX]]></category>
		<category><![CDATA[GAMEDEV]]></category>
		<category><![CDATA[PAPERVISION]]></category>
		<category><![CDATA[PERFORMANCE]]></category>
		<category><![CDATA[PROGRAMMING]]></category>
		<category><![CDATA[TECHNOLOGY]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[panel]]></category>
		<category><![CDATA[TOOLS]]></category>
		<category><![CDATA[utility]]></category>

		<guid isPermaLink="false">http://drawk.wordpress.com/?p=268</guid>
		<description><![CDATA[I have been doing lots of Papervision 3D for a project recently and needed to debug some placement and camera issues.  I did a quick search and found PV3DDebug by Jason Bejot and it worked out great and is a pretty sweet utility I thought I would mention when you need to debug Papervision or [...]]]></description>
			<content:encoded><![CDATA[<p>I have been doing lots of Papervision 3D for a project recently and needed to debug some placement and camera issues.  I did a quick search and found <a href="http://jasonbejot.com/?p=16" target="_blank">PV3DDebug by Jason Bejot </a>and it worked out great and is a pretty sweet utility I thought I would mention when you need to debug Papervision or even for inclusion as a debug console in all your papervision apps and games. It is a good base for your own consoles or debug panels. It is also a great tool to help out with focus and zoom issues and understanding with camera placement.</p>
<p>The code is really easy to drop in and you can get lots of info on the PV3D scenes and camera manipulation.</p>
<ul>
<li><a href="http://jasonbejot.com/?page_id=22" target="_blank">Check out PV3DDebug</a></li>
<li><a href="http://jasonbejot.com/?p=16" target="_blank">Posting on the project</a></li>
</ul>
<p><a href="http://jasonbejot.com/?page_id=22" target="_blank"><img class="alignnone" title="PV3DDebug for Flash AS3" src="http://farm4.static.flickr.com/3074/2884129399_00588f52b5_o.png" alt="" width="383" height="363" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://drawlogic.com/2008/09/24/as3-papervision-3d-debuggingstats-with-pv3ddebug/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A Peek into the AS3 and AVM2 Virtual Machine and &#8216;Elastic Racetrack&#8217;</title>
		<link>http://drawlogic.com/2008/04/22/a-peek-into-the-as3-and-avm2-virtual-machine-and-elastic-racetrack/</link>
		<comments>http://drawlogic.com/2008/04/22/a-peek-into-the-as3-and-avm2-virtual-machine-and-elastic-racetrack/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 01:23:34 +0000</pubDate>
		<dc:creator>drawk</dc:creator>
				<category><![CDATA[ACTIONSCRIPT]]></category>
		<category><![CDATA[ACTIONSCRIPT3]]></category>
		<category><![CDATA[APPLICATIONS]]></category>
		<category><![CDATA[ARCHITECT]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[DEBUGGING]]></category>
		<category><![CDATA[DEVELOPMENT]]></category>
		<category><![CDATA[ENGINE]]></category>
		<category><![CDATA[FLASH]]></category>
		<category><![CDATA[FLEX]]></category>
		<category><![CDATA[GAMEDEV]]></category>
		<category><![CDATA[PERFORMANCE]]></category>
		<category><![CDATA[PROGRAMMING]]></category>
		<category><![CDATA[RENDERING]]></category>
		<category><![CDATA[STANDARDS]]></category>
		<category><![CDATA[TECHNOLOGY]]></category>
		<category><![CDATA[VIRTUAL MACHINES]]></category>
		<category><![CDATA[VISUALIZATION]]></category>
		<category><![CDATA[avm]]></category>
		<category><![CDATA[avm2]]></category>
		<category><![CDATA[cycle]]></category>
		<category><![CDATA[elastic]]></category>
		<category><![CDATA[racetrack]]></category>
		<category><![CDATA[render]]></category>
		<category><![CDATA[tick]]></category>

		<guid isPermaLink="false">http://drawk.wordpress.com/?p=198</guid>
		<description><![CDATA[Sean Christmann has a nice post on the AS3 AVM 2 &#8216;Elastic Racetrack&#8217; cycles or virtual machine tick that runs an ES4 based javascript version of actionscript which we all know and love. The post has some info on how the AVM2 cycles run and can provide benefits to understanding frame rates and how execution [...]]]></description>
			<content:encoded><![CDATA[<p><span class="entry-author-name"><a href="http://www.craftymind.com/2008/04/18/updated-elastic-racetrack-for-flash-9-and-avm2/" target="_blank">Sean Christmann has a nice post on the AS3 AVM 2 &#8216;Elastic Racetrack&#8217; cycles or virtual machine tick</a> that runs an ES4 based javascript version of actionscript which we all know and love.  The post has some info on how the AVM2 cycles run and can provide benefits to understanding frame rates and how execution is divided between script and render as well as player code from user code.</span></p>
<p><a href="http://www.craftymind.com/2008/04/18/updated-elastic-racetrack-for-flash-9-and-avm2/" target="_blank"><img src="http://drawk.files.wordpress.com/2008/04/elasticracetrackexport.png" alt="" /></a></p>
<p><a href="http://www.craftymind.com/2008/04/18/updated-elastic-racetrack-for-flash-9-and-avm2/" target="_blank"><img src="http://drawk.files.wordpress.com/2008/04/marshalledsliceexport.png" alt="" /></a></p>
<ul>
<li>Check out that and more at Craftymind like some other good stuff like <a href="http://www.craftymind.com/2008/04/09/kick-starting-the-garbage-collector-in-actionscript-3-with-air/" target="_blank">garbage collection in AIR with actionscript 3</a> (as3) and <a href="http://www.craftymind.com/2008/03/03/air-utils-saving-classes-to-disk-in-air/" target="_blank">serializing classes to files in AIR with AS3</a></li>
<li><a href="http://www.onflex.org/ted/2005/07/flash-player-mental-model-elastic.php" target="_blank">Original &#8216;Elastic Racetrack&#8217; Post by Ted on Flex in 2005</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://drawlogic.com/2008/04/22/a-peek-into-the-as3-and-avm2-virtual-machine-and-elastic-racetrack/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Helpful Flash Debugging Tools</title>
		<link>http://drawlogic.com/2007/08/10/helpful-flash-debugging-tools/</link>
		<comments>http://drawlogic.com/2007/08/10/helpful-flash-debugging-tools/#comments</comments>
		<pubDate>Fri, 10 Aug 2007 11:06:07 +0000</pubDate>
		<dc:creator>drawk</dc:creator>
				<category><![CDATA[ACTIONSCRIPT]]></category>
		<category><![CDATA[ACTIONSCRIPT3]]></category>
		<category><![CDATA[APPLICATIONS]]></category>
		<category><![CDATA[ARCHITECT]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[BENCHMARK]]></category>
		<category><![CDATA[DEBUGGING]]></category>
		<category><![CDATA[DEVELOPMENT]]></category>
		<category><![CDATA[FLASH]]></category>
		<category><![CDATA[FLEX]]></category>
		<category><![CDATA[LIBRARIES]]></category>
		<category><![CDATA[OPEN SOURCE]]></category>
		<category><![CDATA[PERFORMANCE]]></category>
		<category><![CDATA[PROGRAMMING]]></category>
		<category><![CDATA[TOOLS]]></category>

		<guid isPermaLink="false">http://drawk.wordpress.com/2007/08/10/helpful-flash-debugging-tools/</guid>
		<description><![CDATA[When debugging flash sometimes you need to either debug in browser or check a past version of the Flash player or the new beta player to see how things are looking. Here is a list of some tools beyond the included debugging IDEs FlashCS3 and Flex2 that are helpful to making your flash projects more [...]]]></description>
			<content:encoded><![CDATA[<p>When debugging flash sometimes you need to either debug in browser or check a past version of the Flash player or the new beta player to see how things are looking.  Here is a list of some tools beyond the included debugging IDEs FlashCS3 and Flex2 that are helpful to making your flash projects more bulletproof.</p>
<ul>
<li><a href="http://www.sephiroth.it/weblog/archives/2006/10/flash_switcher_for_firefox.php" target="_blank"><strong>Firefox Flash Version Switcher from Sephiroth </strong></a><a href="http://www.sephiroth.it/weblog/archives/2006/10/flash_switcher_for_firefox.php" target="_blank"><br />
</a></p>
<p style="text-align:center;"><a href="http://www.sephiroth.it/weblog/archives/2006/10/flash_switcher_for_firefox.php" target="_blank"><img src="http://i81.photobucket.com/albums/j223/drawkbox/preview1.gif" border="0" alt="" hspace="10" vspace="10" width="200" height="150" /></a></p>
<p><a href="http://www.sephiroth.it/weblog/archives/2006/10/flash_switcher_for_firefox.php" target="_blank"><strong><br />
</strong></a>Find out if your code is just messed in the latest version or an older version of the flash player.  This <a href="http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_14266" target="_blank">has links to the older versions of the Flash player from Adobe</a> that you are interesting in testing.</li>
<li><a href="http://osflash.org/xray" target="_blank"><strong>Xray Flash/Flex Debugging Kit by John Grden </strong></a><a href="http://osflash.org/xray" target="_blank">XRay is a flash/flex debugger</a> <a href="http://osflash.org/xray" target="_blank"><br />
</a></p>
<p style="text-align:center;"><a href="http://osflash.org/xray" target="_blank"><img src="http://i81.photobucket.com/albums/j223/drawkbox/scaled_60.jpg" border="0" alt="" hspace="10" vspace="10" width="223" height="126" /></a></p>
<p>for real-time debugging and spying on your code. It is 16KB for the connector that you add to your files but it is debugging in style. If you have any issues with a live app or to help during testing Xray is great. It also includes a nifty admin site that allows you to access objects and spy on your code at any time.</p>
<p style="text-align:center;"><img src="http://i81.photobucket.com/albums/j223/drawkbox/fetch.php.png" border="0" alt="" hspace="10" vspace="10" width="500" height="412" /></p>
<p>Xray (The AdminTool) is a <strong>“snapshot viewer”</strong> of the <strong>current state</strong> of your Flash application without impacting the performance or the file size of your application. Xray’s true nature is to look into the very guts of the Flash application and disolve the 2d myth you see on screen to a 3D tangible entity you can truly crawl through.Xray is brought to you by <a class="urlextern" title="http://labs.blitzagency.com/" rel="nofollow" href="http://labs.blitzagency.com/">Blitz Labs</a>.</li>
<li><strong><a href="http://www.marcosweskamp.com/blog/archives/000117.html" target="_blank">AS3 Debugging with Firebug and Actionscript from marcosweskamp</a></strong>When using <a href="http://getfirebug.com/" target="_blank">Firebug </a>(a web developers Swiss army knife for browser debugging) you can also use actionscript to write to the firebug console with this class from <strong><a href="http://www.marcosweskamp.com/blog/archives/000117.html" target="_blank">marcosweskamp</a></strong> The code to <a href="http://www.marcosweskamp.com/blog/docs/Console.as" target="_blank">Console.as for firebug is here</a>.<a href="http://www.marcosweskamp.com/blog/archives/000117.html" target="_blank"><br />
</a></p>
<p style="text-align:center;"><a href="http://www.marcosweskamp.com/blog/archives/000117.html" target="_blank"><img src="http://i81.photobucket.com/albums/j223/drawkbox/firebug.jpg" border="0" alt="" hspace="10" vspace="10" width="480" height="266" /></a></p>
</li>
<li><strong><a href="http://www.senocular.com/flash/actionscript.php?file=ActionScript_3.0/com/senocular/utils/Output.as" target="_blank">Output Panel from Senocular</a></strong><a href="http://www.senocular.com/flash/actionscript.php?file=ActionScript_3.0/com/senocular/utils/Output.as" target="_blank"><br />
Last but not least, try out this class that creates or mimic the output panel in flash</a><a href="http://www.senocular.com/flash/actionscript.php?file=ActionScript_3.0/com/senocular/utils/Output.as" target="_blank"></a>. Another great quick class from <a href="http://www.senocular.com/" target="_blank">senocular</a>.  You have to change your trace command to Output.trace but I recommend that you abstract logging anyways to a method that can determine to trace, Output.trace(str:*) or any further logging you might want to do for debug or application logs (it also makes it easy to switch out logging options).  This Output panel can help when you don&#8217;t&#8217; have the debugger available, or for use in a live debug mode of your application. This class can be implemented in minutes.<a href="http://www.senocular.com/flash/actionscript.php?file=ActionScript_3.0/com/senocular/utils/Output.as" target="_blank"><img src="http://i81.photobucket.com/albums/j223/drawkbox/OUTPUT.png" border="0" alt="" hspace="10" vspace="10" width="446" height="220" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">package</span> com.<span style="color: #660066;">senocular</span>.<span style="color: #660066;">utils</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #660066;">display</span>.<span style="color: #660066;">Shape</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #660066;">display</span>.<span style="color: #660066;">Sprite</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #660066;">display</span>.<span style="color: #660066;">Stage</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #660066;">display</span>.<span style="color: #660066;">GradientType</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #660066;">events</span>.<span style="color: #660066;">Event</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #660066;">events</span>.<span style="color: #660066;">MouseEvent</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #660066;">geom</span>.<span style="color: #660066;">Matrix</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #660066;">text</span>.<span style="color: #660066;">TextField</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #660066;">text</span>.<span style="color: #660066;">TextFieldType</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #660066;">text</span>.<span style="color: #660066;">TextFormat</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #660066;">text</span>.<span style="color: #660066;">TextFormatAlign</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #660066;">text</span>.<span style="color: #660066;">TextFieldAutoSize</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">/**
  * Creates a pseudo Output panel in a publish
  * swf for displaying trace statements.
  * For the output panel to capture trace
  * statements, you must use Output.trace()
  * and add an instance to the stage:
  * stage.addChild(new Output());
  *
  * Note: You may want to place Output in an
  * unnamed package to make it easier to
  * trace within your classes without having
  * to import com.senocular.utils.Output.
  */</span>
  <span style="color: #003366; font-weight: bold;">public</span> <span style="color: #003366; font-weight: bold;">class</span> Output <span style="color: #003366; font-weight: bold;">extends</span> Sprite <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">var</span> output_txt<span style="color: #339933;">:</span>TextField<span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">var</span> titleBar<span style="color: #339933;">:</span>Sprite<span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">private</span> static <span style="color: #003366; font-weight: bold;">var</span> instance<span style="color: #339933;">:</span>Output<span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">private</span> static <span style="color: #003366; font-weight: bold;">var</span> autoExpand<span style="color: #339933;">:</span>Boolean <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">private</span> static <span style="color: #003366; font-weight: bold;">var</span> maxLength<span style="color: #339933;">:</span>int <span style="color: #339933;">=</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">public</span> <span style="color: #003366; font-weight: bold;">function</span> Output<span style="color: #009900;">&#40;</span>outputHeight<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #CC0000;">150</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>instance <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> instance.<span style="color: #660066;">parent</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    instance.<span style="color: #660066;">parent</span>.<span style="color: #660066;">removeChild</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   instance <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
   addChild<span style="color: #009900;">&#40;</span>newOutputField<span style="color: #009900;">&#40;</span>outputHeight<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   addChild<span style="color: #009900;">&#40;</span>newTitleBar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   addEventListener<span style="color: #009900;">&#40;</span>Event.<span style="color: #660066;">ADDED</span><span style="color: #339933;">,</span> added<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   addEventListener<span style="color: #009900;">&#40;</span>Event.<span style="color: #660066;">REMOVED</span><span style="color: #339933;">,</span> removed<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">// public methods</span>
  <span style="color: #003366; font-weight: bold;">public</span> static <span style="color: #003366; font-weight: bold;">function</span> trace<span style="color: #009900;">&#40;</span>str<span style="color: #339933;">:*</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">void</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>instance<span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
   instance.<span style="color: #660066;">output_txt</span>.<span style="color: #660066;">appendText</span><span style="color: #009900;">&#40;</span>str<span style="color: #339933;">+</span>“n”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>instance.<span style="color: #660066;">output_txt</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> maxLength<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    instance.<span style="color: #660066;">output_txt</span>.<span style="color: #660066;">text</span> <span style="color: #339933;">=</span> instance.<span style="color: #660066;">output_txt</span>.<span style="color: #660066;">text</span>.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>maxLength<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
   instance.<span style="color: #660066;">output_txt</span>.<span style="color: #660066;">scrollV</span> <span style="color: #339933;">=</span> instance.<span style="color: #660066;">output_txt</span>.<span style="color: #660066;">maxScrollV</span><span style="color: #339933;">;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>autoExpand <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span>instance.<span style="color: #660066;">output_txt</span>.<span style="color: #660066;">visible</span><span style="color: #009900;">&#41;</span> instance.<span style="color: #660066;">toggleCollapse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #003366; font-weight: bold;">public</span> static <span style="color: #003366; font-weight: bold;">function</span> clear<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">void</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>instance<span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
   instance.<span style="color: #660066;">output_txt</span>.<span style="color: #660066;">text</span> <span style="color: #339933;">=</span> “”<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">function</span> newOutputField<span style="color: #009900;">&#40;</span>outputHeight<span style="color: #339933;">:</span>uint<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>TextField <span style="color: #009900;">&#123;</span>
   output_txt <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> TextField<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   output_txt.<span style="color: #660066;">type</span> <span style="color: #339933;">=</span> TextFieldType.<span style="color: #660066;">INPUT</span><span style="color: #339933;">;</span>
   output_txt.<span style="color: #660066;">border</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
   output_txt.<span style="color: #660066;">borderColor</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
   output_txt.<span style="color: #660066;">background</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
   output_txt.<span style="color: #660066;">backgroundColor</span> <span style="color: #339933;">=</span> 0xFFFFFF<span style="color: #339933;">;</span>
   output_txt.<span style="color: #660066;">height</span> <span style="color: #339933;">=</span> outputHeight<span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> format<span style="color: #339933;">:</span>TextFormat <span style="color: #339933;">=</span> output_txt.<span style="color: #660066;">getTextFormat</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   format.<span style="color: #660066;">font</span> <span style="color: #339933;">=</span> “_typewriter”<span style="color: #339933;">;</span>
   output_txt.<span style="color: #660066;">setTextFormat</span><span style="color: #009900;">&#40;</span>format<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   output_txt.<span style="color: #660066;">defaultTextFormat</span> <span style="color: #339933;">=</span> format<span style="color: #339933;">;</span>
   <span style="color: #000066; font-weight: bold;">return</span> output_txt<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">function</span> newTitleBar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>Sprite <span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> barGraphics<span style="color: #339933;">:</span>Shape <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Shape<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   barGraphics.<span style="color: #000066;">name</span> <span style="color: #339933;">=</span> “bar”<span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> colors<span style="color: #339933;">:</span>Array <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span>0xE0E0F0<span style="color: #339933;">,</span> 0xB0C0D0<span style="color: #339933;">,</span> 0xE0E0F0<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> alphas<span style="color: #339933;">:</span>Array <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> ratios<span style="color: #339933;">:</span>Array <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">50</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">255</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> gradientMatrix<span style="color: #339933;">:</span>Matrix <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Matrix<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   gradientMatrix.<span style="color: #660066;">createGradientBox</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">18</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">18</span><span style="color: #339933;">,</span> Math.<span style="color: #660066;">PI</span><span style="color: #339933;">/</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   barGraphics.<span style="color: #660066;">graphics</span>.<span style="color: #660066;">lineStyle</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   barGraphics.<span style="color: #660066;">graphics</span>.<span style="color: #660066;">beginGradientFill</span><span style="color: #009900;">&#40;</span>GradientType.<span style="color: #660066;">LINEAR</span><span style="color: #339933;">,</span> colors<span style="color: #339933;">,</span> alphas<span style="color: #339933;">,</span> ratios<span style="color: #339933;">,</span> gradientMatrix<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   barGraphics.<span style="color: #660066;">graphics</span>.<span style="color: #660066;">drawRect</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">18</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">18</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #003366; font-weight: bold;">var</span> barLabel<span style="color: #339933;">:</span>TextField <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> TextField<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   barLabel.<span style="color: #660066;">autoSize</span> <span style="color: #339933;">=</span> TextFieldAutoSize.<span style="color: #660066;">LEFT</span><span style="color: #339933;">;</span>
   barLabel.<span style="color: #660066;">selectable</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
   barLabel.<span style="color: #660066;">text</span> <span style="color: #339933;">=</span> “Output”<span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> format<span style="color: #339933;">:</span>TextFormat <span style="color: #339933;">=</span> barLabel.<span style="color: #660066;">getTextFormat</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   format.<span style="color: #660066;">font</span> <span style="color: #339933;">=</span> “_sans”<span style="color: #339933;">;</span>
   barLabel.<span style="color: #660066;">setTextFormat</span><span style="color: #009900;">&#40;</span>format<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   titleBar <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Sprite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   titleBar.<span style="color: #660066;">addChild</span><span style="color: #009900;">&#40;</span>barGraphics<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   titleBar.<span style="color: #660066;">addChild</span><span style="color: #009900;">&#40;</span>barLabel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000066; font-weight: bold;">return</span> titleBar<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Event handlers</span>
  <span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">function</span> added<span style="color: #009900;">&#40;</span>evt<span style="color: #339933;">:</span>Event<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">void</span> <span style="color: #009900;">&#123;</span>
   stage.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span>Event.<span style="color: #660066;">RESIZE</span><span style="color: #339933;">,</span> fitToStage<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   titleBar.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span>MouseEvent.<span style="color: #660066;">CLICK</span><span style="color: #339933;">,</span> toggleCollapse<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   fitToStage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   toggleCollapse<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">function</span> removed<span style="color: #009900;">&#40;</span>evt<span style="color: #339933;">:</span>Event<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">void</span> <span style="color: #009900;">&#123;</span>
   stage.<span style="color: #660066;">removeEventListener</span><span style="color: #009900;">&#40;</span>Event.<span style="color: #660066;">RESIZE</span><span style="color: #339933;">,</span> fitToStage<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   titleBar.<span style="color: #660066;">removeEventListener</span><span style="color: #009900;">&#40;</span>MouseEvent.<span style="color: #660066;">CLICK</span><span style="color: #339933;">,</span> toggleCollapse<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">function</span> toggleCollapse<span style="color: #009900;">&#40;</span>evt<span style="color: #339933;">:</span>Event <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">void</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>instance<span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
   output_txt.<span style="color: #660066;">visible</span> <span style="color: #339933;">=</span> <span style="color: #339933;">!</span>output_txt.<span style="color: #660066;">visible</span><span style="color: #339933;">;</span>
   fitToStage<span style="color: #009900;">&#40;</span>evt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">function</span> fitToStage<span style="color: #009900;">&#40;</span>evt<span style="color: #339933;">:</span>Event <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">void</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>stage<span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
   output_txt.<span style="color: #660066;">width</span> <span style="color: #339933;">=</span> stage.<span style="color: #660066;">stageWidth</span><span style="color: #339933;">;</span>
   output_txt.<span style="color: #660066;">y</span> <span style="color: #339933;">=</span> stage.<span style="color: #660066;">stageHeight</span> <span style="color: #339933;">-</span> output_txt.<span style="color: #660066;">height</span><span style="color: #339933;">;</span>
   titleBar.<span style="color: #660066;">y</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>output_txt.<span style="color: #660066;">visible</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> output_txt.<span style="color: #660066;">y</span> <span style="color: #339933;">-</span> titleBar.<span style="color: #660066;">height</span> <span style="color: #339933;">:</span> stage.<span style="color: #660066;">stageHeight</span> <span style="color: #339933;">-</span> titleBar.<span style="color: #660066;">height</span><span style="color: #339933;">;</span>
   titleBar.<span style="color: #660066;">getChildByName</span><span style="color: #009900;">&#40;</span>“bar”<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span> <span style="color: #339933;">=</span> stage.<span style="color: #660066;">stageWidth</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

</li>
</ul>
<p><strong>Other debug and logging tools that may help are listed here from OSflash.</strong></p>
<ul>
<li class="level1"><strong><a class="wikilink1" title="alcon" href="http://osflash.org/projects/alcon">Alcon</a> &#8211; An external output console for Actionscript debugging</strong></li>
<li class="level1"><a class="wikilink1" title="luminicbox.log" href="http://osflash.org/luminicbox.log">LuminicBox.Log</a> &#8211; A logging <acronym title="Application Programming Interface">API</acronym> and output console for ActionScript</li>
<li class="level1"></li>
<li><a class="wikilink1" title="debugit" href="http://osflash.org/debugit">DebugIt</a> &#8211; Displays traced data in a seperate SWF so you can debug outside of Flash, while running your application in its shell/production environment.</li>
<li><a class="wikilink1" title="printrdebugger" href="http://osflash.org/printrdebugger">Print_r Debugger</a> &#8211; Brings <acronym title="Hypertext Preprocessor">PHP</acronym>‘s “print_r” to Flash, invaluable once you start to use it. Free, Complete Source Available</li>
<li><a class="urlextern" title="http://sock4log.sourceforge.net/" rel="nofollow" href="http://sock4log.sourceforge.net/">Sock4Log</a> &#8211; JAVA application which displays traced data from SWF and other (<acronym title="Hypertext Preprocessor">PHP</acronym>,<acronym title="JavaScript">JS</acronym>&#8230;). Could be a command line or windowed application.</li>
</ul>
<ul></ul>
]]></content:encoded>
			<wfw:commentRss>http://drawlogic.com/2007/08/10/helpful-flash-debugging-tools/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

