<?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>Big Bad Code &#187; flash</title>
	<atom:link href="http://bigbadcode.com/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://bigbadcode.com</link>
	<description>this blog is retired. I&#039;m leaving it up as a reference</description>
	<lastBuildDate>Wed, 19 Aug 2009 21:49:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using Flexbuilder to edit and debug Flash Applications</title>
		<link>http://bigbadcode.com/2008/04/10/flexbuilder_for_flash/</link>
		<comments>http://bigbadcode.com/2008/04/10/flexbuilder_for_flash/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 05:26:38 +0000</pubDate>
		<dc:creator>jbloom</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flexbuilder3]]></category>

		<guid isPermaLink="false">http://bigbadcode.com/?p=139</guid>
		<description><![CDATA[The goal here is to use the excellent code editing and application debugging/profiling available in Flexbuilder and still have the rapid prototyping and layout ability that the Flash IDE gives to you. To get started create a new &#8220;Actionscript Project&#8221; in Flexbuilder. Now we will add some code to testDebug.as that traces out when the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">The goal here is to use the excellent code editing and application debugging/profiling available in Flexbuilder and still have the rapid prototyping and layout ability that the Flash IDE gives to you.</p>
<p style="text-align: left;">To get started create a new &#8220;Actionscript Project&#8221; in Flexbuilder.<a href="http://bigbadcode.com/wp-content/uploads/2008/04/picture-3.png"><img class="alignnone size-medium wp-image-140" title="new project" src="http://bigbadcode.com/wp-content/uploads/2008/04/picture-3-300x285.png" alt="" width="300" height="285" /></a></p>
<p style="text-align: left;">Now we will add some code to testDebug.as that traces out when the application is run:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> testDebug <span style="color: #0066CC;">extends</span> Sprite
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> testDebug<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;I am created&quot;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p style="text-align: left;">With that code saved we will Debug this actionscript project and if everything is working correctly you should see something like this in your console window:</p>
<p style="text-align: left;"><img class="alignnone size-medium wp-image-142" title="picture-4" src="http://bigbadcode.com/wp-content/uploads/2008/04/picture-4-300x38.png" alt="" width="300" height="38" /></p>
<p style="text-align: left;">So far everything is working correctly in Flexbuilder, now lets get Flash into the action.</p>
<p style="text-align: left;">Open up flash and create a new Flash file, lets call it TestFlexBuilderIntegration.fla. Add some timeline animation or something so you know it&#8217;s coming from the Flash IDE, save this file into the root directory of your new Flex project.</p>
<p style="text-align: left;">Now set the document class of your Flash file to &#8216;testDebug.&#8217; The AS class that we wrote in flexbuilder will now be the document class for your flash file as well.</p>
<p style="text-align: left;">Here come the tricks, under Publish Settings enable &#8220;Permit debugging&#8221;</p>
<p style="text-align: left;"><a href="http://bigbadcode.com/wp-content/uploads/2008/04/picture-1.png"><img class="alignnone size-medium wp-image-143" title="permit_debugging" src="http://bigbadcode.com/wp-content/uploads/2008/04/picture-1-300x228.png" alt="" width="300" height="228" /></a></p>
<p>Next in the Formats tab of Publish Settings change the .swf file to be published to the flexbuilder bin-debug folder.</p>
<p><a href="http://bigbadcode.com/wp-content/uploads/2008/04/picture-5.png"><img class="alignnone size-medium wp-image-144" title="publish_where" src="http://bigbadcode.com/wp-content/uploads/2008/04/picture-5-300x124.png" alt="" width="300" height="124" /></a></p>
<p>The path will be something like</p>
<pre>"/Users/YourName/Workspace/testDebug/bin-debug"</pre>
<p>Now if you test the movie in Flash you should see your animation as well as the trace &#8220;I am created&#8221; in the flash IDE.</p>
<p>For the final steps we go back to Flexbuilder and under the html-template folder open index.template.html in a text editor. This is a template file that generates the index.html that is used to launch your app. We are going to update it so it points to the .swf generated by Flash IDE instead of Flexbuilder.</p>
<p>Replace all occurrences of ${swf} with the name of your Flash IDE generated swf file. In this case it would be TestFlexBuilderIntegration.</p>
<p>The moment of truth! In Flexbuilder Debug your project, it should launch the .swf in a browser for you and the animation you created should be playing, additionally the trace(&#8220;I am created&#8221;) line should show up in your console.</p>
<p>If Flexbuilder has trouble connecting to the debugger, right click in the swf in the browser and change the debugger connection to 127.0.0.1 and that should solve that issue.</p>
<p>Now you have the full power of Flexbuilder to code and debug and you still have the Flash IDE to layout movieclips and rapidly prototype things. Sweet.</p>
<p><strong>Notes:</strong></p>
<p>As you make changes to the code in Flexbuilder, you&#8217;ll need to go back to Flash and republish.</p>
<p>Profiling should probably work as well though I haven&#8217;t played with it yet.</p>
<p>You can set breakpoints in Flexbuilder without needing to republish.</p>
]]></content:encoded>
			<wfw:commentRss>http://bigbadcode.com/2008/04/10/flexbuilder_for_flash/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>XRay Logging with AS3</title>
		<link>http://bigbadcode.com/2007/10/30/xray-logging-with-as3/</link>
		<comments>http://bigbadcode.com/2007/10/30/xray-logging-with-as3/#comments</comments>
		<pubDate>Tue, 30 Oct 2007 23:55:24 +0000</pubDate>
		<dc:creator>jbloom</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[xray]]></category>

		<guid isPermaLink="false">http://bigbadcode.com/2007/10/30/xray-logging-with-as3/</guid>
		<description><![CDATA[Using Xray you can utilize logging in your AS3 development in a nice clean manner. One of the great benefits here is that your logging/debugging process can be the same when developing locally and when you are running on your development and production servers. To get started download the latest xray code from their SVN [...]]]></description>
			<content:encoded><![CDATA[<p>Using <a href="http://osflash.org/xray">Xray</a> you can utilize logging in your AS3 development in a nice clean manner. One of the great benefits here is that your logging/debugging process can be the same when developing locally <strong>and</strong> when you are running on your development and production servers.</p>
<p>To get started download the latest xray code from their SVN repository.<br />
<a href="http://code.google.com/p/osflash-xray/source">http://code.google.com/p/osflash-xray/source</a></p>
<p>Then create a new AS3 flash document using the code below as the document class:<br />
Make sure that you add the &#8216;trunk&#8217; directory that you downloaded to your class path (so flash can find the xray files)</p>
<p>Once you are compiling correctly, launch the xray viewer in a browser from <a href="http://www.rockonflash.com/xray/flex/Xray.html">http://www.rockonflash.com/xray/flex/Xray.html</a>. You will get a notification about not finding a SWF to connect with, ignore this for now (full xray support is not yet therefor AS3 projects). Make sure that the Show Output checkbox along the bottom is checked.</p>
<p>Now if you click the red square in your swf player, you should see the following show up in the XRay viewer windows.</p>
<p>Congratulations you are now logging. Big thanks to <a href="http://rockonflash.com/blog/">John Grden </a> and everyone else contributing to Flash development methodologies.</p>
<p><a href="http://bigbadcode.com/wp-content/uploads/2007/10/picture-4.png" title="picture-4.png"><img src="http://bigbadcode.com/wp-content/uploads/2007/10/picture-4.thumbnail.png" alt="picture-4.png" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">blitzagency</span>.<span style="color: #006600;">xray</span>.<span style="color: #006600;">logger</span>.<span style="color: #006600;">XrayLog</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #66cc66;">*</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> testLoggingAS <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">log</span>:XrayLog = <span style="color: #000000; font-weight: bold;">new</span> XrayLog<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> mc:<span style="color: #0066CC;">MovieClip</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> testLoggingAS<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">log</span>.<span style="color: #006600;">debug</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Application starting up&quot;</span><span style="color: #66cc66;">&#41;</span>;
			createClickableMovieClip<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #0066CC;">log</span>.<span style="color: #006600;">debug</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Application has completed startup&quot;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> showTheClick<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">log</span>.<span style="color: #006600;">debug</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Square was clicked. Tracing out the Event&quot;</span>, <span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">e</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> createClickableMovieClip<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			mc = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			mc.<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;ClickableMovieClip&quot;</span>
			mc.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0xFF0000<span style="color: #66cc66;">&#41;</span>;
			mc.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">80</span><span style="color: #66cc66;">&#41;</span>;
			mc.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			mc.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">80</span>;
			mc.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;">60</span>;
			addChild<span style="color: #66cc66;">&#40;</span>mc<span style="color: #66cc66;">&#41;</span>;
			mc.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, showTheClick<span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bigbadcode.com/2007/10/30/xray-logging-with-as3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

