<?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>WS-Blog &#187; MTASC</title>
	<atom:link href="http://www.websector.de/blog/category/flash/mtasc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.websector.de/blog</link>
	<description>// Flex - AIR - Flash - JavaScript</description>
	<lastBuildDate>Wed, 18 Jan 2012 12:17:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Extension for Zeroi: XTracePublisher</title>
		<link>http://www.websector.de/blog/2007/03/12/extension-for-zeroi-xtracepublisher/</link>
		<comments>http://www.websector.de/blog/2007/03/12/extension-for-zeroi-xtracepublisher/#comments</comments>
		<pubDate>Mon, 12 Mar 2007 03:30:00 +0000</pubDate>
		<dc:creator>sectore</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[MTASC]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.websector.de/blog/2007/03/12/extension-for-zeroi-xtracepublisher/</guid>
		<description><![CDATA[Xtrace is a popular debugger console on OS X for logging your trace() data outside the Flash IDE. For easier handling I decided to write an extension for Zeroi that keeps your standard trace() methods in your code. Here is a screen of a XTrace window receiving Zerois debug messages: Instructions Grab the latest source [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://developer.mabwebdesign.com/xtrace.html">Xtrace</a> is a popular debugger console on OS X for logging your <code>trace()</code> data outside the Flash IDE. For easier handling I decided to write an extension for <a href="http://osflash.org/Zeroi">Zeroi</a> that keeps your standard <code>trace()</code> methods in your code.</p>
<p><span id="more-18"></span></p>
<p>Here is a screen of a XTrace window receiving Zerois debug messages:</p>
<p><img src="http://www.websector.de/blog/wp-content/uploads/2007/03/xtrace-window.png" alt="XTrace Window" /></p>
<h2>Instructions</h2>
<ol>
<li>Grab the latest source of Zeroi from its <a href="http://code.google.com/p/zeroi/source">Subversion Repository</a>. You will find there the new extension for XTrace, too.</li>
<li>Download and install <a href="http://developer.mabwebdesign.com/xtrace.html">XTrace</a>. For enjoying the latest features (e.g. text highlighting) it&#8217;s recommended to use the <a href="http://svn.mabwebdesign.com/xtrace">XTrace SVN Repository</a>.</li>
<li>Download the <a href="http://www.websector.de/blog/download-manager.php?id=1">Zeroi example</a> and follow the steps 4 up to 7 described in my previous post called <a href="http://www.websector.de/blog/2007/03/04/debugging-with-mtasc-ant-and-zeroi/">&#8220;Debugging with MTASC, Ant and Zeroi&#8221;</a>.</li>
<li>Add <em>XTracePublisher</em> as Zerois publisher to MTASC <code>-trace</code> flag. For this purpose you have to change only one line in the Ant script located in my example:
<phpcode>
<div class="actionscript" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">&lt;arg value=<span class="st0">&quot;-trace&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;arg value=<span class="st0">&quot;org.osflash.Zeroi.logging.LoggerClass.log&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;arg value=<span class="st0">&quot;org/osflash/Zeroi/logging/LoggerClass&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;!&#8211; point <span class="kw3">this</span> argument to XTracePublisher &#8211;&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;arg value=<span class="st0">&quot;org/osflash/Zeroi/logging/publisher/XTracePublisher&quot;</span>/&gt;</div>
</li>
</ol>
</div>
</phpcode>
	</li>
<li>If you familiar with Terminal you can also create a small shell script to run MTASC instead using Ant. Open Terminal, change directory<br />
<code>cd {path/to/downloaded/zeroiExample}</code><br />
and create a new file named <em>build</em><code>pico ./build</code></p>
<p>Type then the following line for running MTASC:</p>
<phpcode>
<div class="actionscript" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span>path/to/mtasc<span class="br0">&#125;</span> -cp <span class="br0">&#123;</span>path/to/your/own/core/classes<span class="br0">&#125;</span> -cp <span class="br0">&#123;</span>path/to/MM/core/classes<span class="br0">&#125;</span> -cp <span class="br0">&#123;</span>path/to/zeroi/<span class="kw2">class</span>/package<span class="br0">&#125;</span> -cp ./source/ -swf ./deploy/zeroiExample.<span class="me1">swf</span> ./ZeroiExample.<span class="me1">as</span> -<span class="kw3">trace</span> org.<span class="me1">osflash</span>.<span class="me1">Zeroi</span>.<span class="me1">logging</span>.<span class="me1">LoggerClass</span>.<span class="kw3">log</span> org/osflash/Zeroi/logging/LoggerClass org/osflash/Zeroi/logging/publisher/XTracePublisher -frame <span class="nu0">1</span> -<span class="kw3">version</span> <span class="nu0">7</span> -v -main</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
</phpcode>
For opening the *.swf with the FlashPlayer type additionally:</p>
<phpcode>
<div class="actionscript" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">open -a SAFlashPlayer ./deploy/zeroiExample.<span class="me1">swf</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
</phpcode>
<p>Save the file, close pico and run the script typing <code>./build</code></li>
</ol>
<h2>Wish list</h2>
<ul>
<li>Adding more log levels, such as &#8220;INFO&#8221; and &#8220;FATAL&#8221;. I&#8217;ve got in contact with <a href="http://developer.mabwebdesign.com/about.html">Michael Bianco</a> <img src='http://www.websector.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  .</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.websector.de/blog/2007/03/12/extension-for-zeroi-xtracepublisher/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Debugging with MTASC, Ant and Zeroi</title>
		<link>http://www.websector.de/blog/2007/03/04/debugging-with-mtasc-ant-and-zeroi/</link>
		<comments>http://www.websector.de/blog/2007/03/04/debugging-with-mtasc-ant-and-zeroi/#comments</comments>
		<pubDate>Sun, 04 Mar 2007 18:43:30 +0000</pubDate>
		<dc:creator>sectore</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[MTASC]]></category>

		<guid isPermaLink="false">http://www.websector.de/blog/2007/03/04/debugging-with-mtasc-ant-and-zeroi/</guid>
		<description><![CDATA[In my previous posts &#8220;trace() outside the Flash IDE with tail&#8221; and &#8220;Are you looking for AFTERTHOUGHT on OS X?&#8221; I described two similar ways for debugging Flash movies outside the Flash IDE. In fact, it&#8217;s relatively simple to use the Flash Debug Player in connection with the logging file called flashlog.txt but it has [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous posts <a href="http://www.websector.de/blog/2007/02/21/are-you-looking-for-afterthought-on-os-x/">&#8220;trace() outside the Flash IDE with tail&#8221;</a> and <a href="http://www.websector.de/blog/2007/02/21/are-you-looking-for-afterthought-on-os-x/">&#8220;Are you looking for AFTERTHOUGHT on OS X?&#8221;</a> I described two similar ways for debugging Flash movies outside the Flash IDE. In fact, it&#8217;s relatively simple to use the Flash Debug Player in connection with the logging file called <em>flashlog.txt</em> but it has only got one big disadvantage: Instead of outputting structured data in predetermined levels you&#8217;ll get tons of unstructured lines.</p>
<p><span id="more-16"></span></p>
<h2>Introduction</h2>
<p>A couple of weeks ago, I did <a href="http://www.bmw.com/com/en/index_highend.html?prm_content=../../com/en/newvehicles/x5/x5/2006/experience/phase_3/_highend/xml/experience.xml">this project</a> on a team with <a href="http://soenkerohde.com/">Sönke Rohde</a>. He showed me a better way for debugging Flash movies using <a href="http://osflash.org/zeroi">Zeroi</a> developed by himself and <a href="http://www.helpqlodhelp.com/blog/">Ralf Bokelberg</a>. Zeroi is a package of classes that supports MTASC&#8217;s option for <a href="http://www.mtasc.org/#trace">customizing trace() functions</a> and the implementation of different log levels without changing code of your Flash application. You can use it with different debugging tools such as <a href="http://sos.powerflasher.de/">SOS</a>, <a href="http://osflash.org/xray">X-Ray</a> or <a href="http://www.luminicbox.com/blog/default.aspx?page=post&#038;id=2">LuminicBox.Log</a>. One of the most important feature is its ability to broadcast debug messages including additional information about class name, method name, line number and a error level with a standard <code>trace()</code> method.</p>
<p>For example: <code>trace("i This is my message");</code> will be displayed as <code>MyClass::myMethod Line>> This is my message</code>. Additionally, you can add a character for an error level <code>d = debug, i = info, w = warn, e = error, f = fatal</code>.</p>
<h2>Example</h2>
</p>
<p>Click the buttons below to view the different debug messages.</p>
<div id="zeroiExample" width="500" height="45">
<p>The movie requires the latest <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a>.</p>
</div>
<p><script type="text/javascript">
   var so2 = new SWFObject("http://www.websector.de/blog/wp-content/uploads/2007/03/zeroiExample.swf", "zeroiExample", "500", "45", "7", "#FFF");
   so2.addParam("quality", "best");
   so2.write("zeroiExample");
</script></p>
<p>In this example the <a href="http://www.luminicbox.com/blog/default.aspx?page=post&#038;id=2">LuminicBox.Log</a> is used as a debugger console. Open the LuminicBox.Log only once.</p>
<div id="flashinspector" width="500" height="300">
<p>The movie requires the latest <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a>.</p>
</div>
<p><script type="text/javascript">
   var so = new SWFObject("http://www.websector.de/blog/wp-content/uploads/2007/03/FlashInspector.swf", "flashinspector", "500", "300", "7", "#06324D");
   so.addParam("quality", "best");
   so.write("flashinspector");
</script></p>
<p>Have a look inside the main class named <em>ZeroiExample.as</em>. It includes only standard <code>trace()</code> methods.</p>
<phpcode>
<div class="codeHeadlineBox">
<p>ZeroiExample.as ( <a href="http://www.websector.de/blog/wp-content/uploads/2007/03/04/ZeroiExample.as">Download code</a> )</p>
</div>
<div class="actionscript" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="coMULTI">/**</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">* ZeroiExample</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">* @author Jens Krause [www.websector.de]</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">*/</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">import</span> mx.<span class="me1">utils</span>.<span class="me1">Delegate</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">class</span> ZeroiExample</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">private</span> <span class="kw3">static</span> <span class="kw2">var</span> example: ZeroiExample = <span class="kw2">null</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> __timeline: <span class="kw3">MovieClip</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">function</span> ZeroiExample<span class="br0">&#40;</span>t: <span class="kw3">MovieClip</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span> <span class="br0">&#40;</span><span class="st0">&quot;i instance of ZeroiExample created&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; __timeline = t;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; initButtons<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> initButtons <span class="br0">&#40;</span><span class="br0">&#41;</span>: <span class="kw3">Void</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> labels: <span class="kw3">Array</span> = <span class="br0">&#91;</span><span class="st0">&quot;debug&quot;</span>, <span class="st0">&quot;info&quot;</span>, <span class="st0">&quot;warn&quot;</span>, <span class="st0">&quot;error&quot;</span>, <span class="st0">&quot;fatal&quot;</span><span class="br0">&#93;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i : <span class="kw3">Number</span> = <span class="nu0">0</span>; i &lt;labels.<span class="kw3">length</span>; i++<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> <span class="kw3">button</span>: <span class="kw3">MovieClip</span> = __timeline.<span class="kw3">attachMovie</span><span class="br0">&#40;</span><span class="st0">&quot;button&quot;</span>, <span class="st0">&quot;button&quot;</span> + i, __timeline.<span class="kw3">getNextHighestDepth</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="br0">&#123;</span>id: i, <span class="kw3">_x</span>: i*<span class="nu0">100</span>, <span class="kw3">_y</span>: <span class="nu0">30</span><span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">button</span>.<span class="me1">label</span>.<span class="kw3">text</span> = labels<span class="br0">&#91;</span>i<span class="br0">&#93;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">button</span>.<span class="kw3">onPress</span> = <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> ZeroiExample.<span class="me1">instance</span>.<span class="me1">traceExamples</span><span class="br0">&#40;</span><span class="kw3">this</span>.<span class="me1">id</span><span class="br0">&#41;</span>; <span class="br0">&#125;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> traceExamples <span class="br0">&#40;</span>$id: <span class="kw3">Number</span><span class="br0">&#41;</span>: <span class="kw3">Void</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">switch</span> <span class="br0">&#40;</span>$id<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="nu0">0</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// this is a debug message</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span> <span class="br0">&#40;</span><span class="st0">&quot;d buttons id =&gt; &quot;</span> + $id<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="nu0">1</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// this is an info message</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span> <span class="br0">&#40;</span><span class="st0">&quot;i buttons id =&gt; &quot;</span> + $id<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="nu0">2</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// this is a warn message</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span> <span class="br0">&#40;</span><span class="st0">&quot;w buttons id =&gt; &quot;</span> + $id<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="nu0">3</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// this is an error message</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span> <span class="br0">&#40;</span><span class="st0">&quot;e buttons id =&gt; &quot;</span> + $id<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="nu0">4</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// this is an fatal message</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span> <span class="br0">&#40;</span><span class="st0">&quot;f buttons id =&gt; &quot;</span> + $id<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">default</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span> <span class="br0">&#40;</span><span class="st0">&quot;w $id has&#8217;nt defined&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">public</span> <span class="kw3">static</span> <span class="kw2">function</span> main <span class="br0">&#40;</span>t: <span class="kw3">MovieClip</span><span class="br0">&#41;</span> : <span class="kw3">Void</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>ZeroiExample.<span class="me1">example</span> == <span class="kw2">null</span><span class="br0">&#41;</span> ZeroiExample.<span class="me1">example</span> = <span class="kw2">new</span> ZeroiExample<span class="br0">&#40;</span>t<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</phpcode>
<p>For creating the example above I&#8217;ve used the following Ant script. In the next chapter I&#8217;ll give you detailed instructions to use Zeroi with Ant.</p>
<phpcode>
<div class="codeHeadlineBox">
<p>build.xml ( <a href="http://www.websector.de/blog/wp-content/uploads/2007/03/04/build.xml">Download code</a> )</p>
</div>
<div class="actionscript" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">&lt;?<span class="kw3">xml</span> <span class="kw3">version</span>=<span class="st0">&#8217;1.0&#8242;</span> encoding=<span class="st0">&quot;utf-8&quot;</span>?&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;project <span class="kw3">name</span>=<span class="st0">&quot;zeroi example&quot;</span> <span class="kw2">default</span>=<span class="st0">&quot;run&quot;</span> basedir=<span class="st0">&quot;.&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &lt;description&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; buildfile <span class="kw1">for</span> zeroi<span class="st0">&#8216;s example</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &lt;/description&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &lt;target name=&quot;deploy&quot; description=&quot;Compiles an existing SWF file with MTASC for debugging&quot;&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; defines ant properties, you&#8217;</span>ll find more properties <span class="kw1">in</span> <span class="st0">&quot;build.jk.properties&quot;</span> &#8211;&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;property <span class="kw3">name</span>=<span class="st0">&quot;targetswf&quot;</span> value=<span class="st0">&quot;zeroiExample.swf&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;property <span class="kw3">name</span>=<span class="st0">&quot;mainclass&quot;</span> value=<span class="st0">&quot;ZeroiExample.as&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;property <span class="kw3">name</span>=<span class="st0">&quot;classframe&quot;</span> value=<span class="st0">&quot;1&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;property <span class="kw3">name</span>=<span class="st0">&quot;version&quot;</span> value=<span class="st0">&quot;7&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;exec executable=<span class="st0">&quot;${mtasc}&quot;</span> failonerror=<span class="st0">&quot;true&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; runs mtasc adding following <span class="kw3">arguments</span> &#8211;&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;-version&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;${version}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;-cp&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;${content.classpath}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;-cp&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;${zeroi.classpath}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;-cp&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;${core.classpath}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;-swf&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;${deploy.folder}/${targetswf}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;-frame&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;${classframe}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;-main&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=<span class="st0">&quot;${content.classpath}/${mainclass}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; adds zeroi<span class="st0">&#8216;s trace functions &#8211;&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=&quot;-trace&quot;/&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=&quot;org.osflash.zeroi.logging.LoggerClass.log&quot;/&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=&quot;org/osflash/zeroi/logging/LoggerClass&quot;/&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg value=&quot;org/osflash/zeroi/logging/publisher/LuminicPublisher&quot;/&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/exec&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/target&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &lt;target name=&quot;run&quot; depends=&quot;deploy&quot; description=&quot;opens SWF&quot;&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; opens the *.swf with the Flash Player (Standalone) &#8211;&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; Note: The following command is for OS X users only, it won&#8217;</span>t run <span class="kw3">on</span> windows &#8211;&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;exec executable=<span class="st0">&quot;open&quot;</span> dir=<span class="st0">&quot;.&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;arg line=<span class="st0">&quot;-a ${flashplayer.v9} ${deploy.folder}/${targetswf}&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/exec&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &lt;/target&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;/project&gt;</div>
</li>
</ol>
</div>
</phpcode>
<h2>Instructions</h2>
<p>All you need are <a href="http://www.mtasc.org/">MTASC</a>, a debugger tool described above, <a href="http://ant.apache.org/">Ant</a> and the <a href="http://osflash.org/zeroi#download">Zeroi package</a>. It&#8217;s recommend to use <a href="http://www.eclipse.org">Eclipse</a> and <a href="http://fdt.powerflasher.com">FDT</a> as well.</p>
<ol>
<li><a href="http://www.websector.de/blog/?download=zeroiExample">Download the Zeroi example</a> and unzip the file.</li>
<li>Grab the latest <a href="http://osflash.org/zeroi#download">Zeroi package</a> and unzip the file.</li>
<li>For this example you&#8217;ll need the LuminicBox.Log, too. <a href="http://www.luminicbox.com/blog/default.aspx?page=post&#038;id=2">Download</a> and open it.<br /><strong>Note:</strong> Open the LuminicBox.Log only once.</li>
<li>Make sure, that you have installed MTASC successfully as described on <a href="http://www.mtasc.org/#install">mtasc.org</a>. If you&#8217;re on a Mac (PPC or Intel), you&#8217;ll find the latest binaries (v.1.13) on <a href="http://lists.motion-twin.com/pipermail/mtasc/2007-February/030170.html">MTASC&#8217;s mailing list</a>.</li>
<li>Open Eclipse, create a new Flash Project <em>File -> New -> New Flash Project</em> and link it to the folder &#8220;Zeroi example&#8221;: First you have to uncheck <em>&#8220;use default location&#8221;</em>. Secondly, browse to the folder where the downloaded example is located.</li>
<li>Customize the property values in <em>build.jk.properties</em> and add this file to Ant&#8217;s Preferences on Eclipse: <em>Preferences -> Type &#8220;Runtime&#8221; in the search field -> Properties -> Add Files</em><br /><strong>Note:</strong> Windows users have to change the target called &#8220;run&#8221; located in the <em>build.xml</em> as well. At present, it only runs on OS X. If there&#8217;s anyone out there who&#8217;s familiar with Ant on windows, feel free to post a comment for this issue.</li>
<li>On Eclipse open the Ant view <em>Window -> Show view -> Ant</em>, drag the <em>build.xml</em> located in the Flash Explorer to its Ant view and press the green button to run the script.
<p><img src="http://www.websector.de/blog/wp-content/uploads/2007/03/eclipse-ant-view.png" alt="Eclipse Ant View" height="408" width="359"/></p>
</li>
<li>If you use other debugger tools, you&#8217;ll only have to change one line located in <em>build.xml</em>
<phpcode>
<div class="actionscript" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="co1">// using XRay</span></div>
</li>
<li class="li1">
<div class="de1">&lt;arg value=<span class="st0">&quot;org/osflash/zeroi/logging/publisher/XRayPublisher&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// OR</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// using SOS</span></div>
</li>
<li class="li1">
<div class="de1">&lt;arg value=<span class="st0">&quot;org/osflash/zeroi/logging/publisher/SOSPublisher&quot;</span>/&gt;</div>
</li>
</ol>
</div>
</phpcode></li>
</ol>
<p>Happy debugging <img src='http://www.websector.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.websector.de/blog/2007/03/04/debugging-with-mtasc-ant-and-zeroi/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

