<?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>Ajar Productions &#187; ActionScript</title>
	<atom:link href="http://ajarproductions.com/blog/category/actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://ajarproductions.com/blog</link>
	<description>Animation &#124; Design &#124; Development</description>
	<lastBuildDate>Mon, 21 May 2012 02:13:31 +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>SmartMouthRT (Real-Time) Lipsyncing Preview</title>
		<link>http://ajarproductions.com/blog/2012/05/10/smartmouthrt-real-time-lipsyncing-preview/</link>
		<comments>http://ajarproductions.com/blog/2012/05/10/smartmouthrt-real-time-lipsyncing-preview/#comments</comments>
		<pubDate>Thu, 10 May 2012 15:36:27 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[lipsync]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=1184</guid>
		<description><![CDATA[Ever since our SmartMouth auto-lipsyncing Flash extension was released, people have been asking about lipsyncing in real time&#8230;Well, we&#8217;re getting pretty close to having such a product ready for purchase. SmartMouthRT is an easy-to-use ActionScript 3 library that allows for on-the-fly lipsyncing. With Adobe&#8217;s packaging utilities for Android and iOS (iPhone/iPad), SmartMouthRT could easily be [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since our <a title="SmartMouth Flash Extension" href="http://ajarproductions.com/pages/products/smartmouth/" target="_blank">SmartMouth</a> auto-lipsyncing Flash extension was released, people have been asking about lipsyncing in real time&#8230;Well, we&#8217;re getting pretty close to having such a product ready for purchase. <em>SmartMouthRT</em> is an easy-to-use ActionScript 3 library that allows for on-the-fly lipsyncing. With Adobe&#8217;s packaging utilities for Android and iOS (iPhone/iPad), SmartMouthRT could easily be used for mobile apps as well. We&#8217;ve put a little demo video together to show you what it&#8217;s all about, which includes behind-the-scenes footage of the assets and code used to make the demo.</p>
<p><iframe src="http://player.vimeo.com/video/41895502" width="580" height="428" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p><strong>Voices</strong>: Betsie Bush and Peter Yearsley (<a title="LibriVox" href="http://librivox.org" target="_blank">librivox.org</a>)<br />
<strong>Music</strong>: <em>Baby, Please Don&#8217;t Go</em> by Big Bill Broonzy</p>
<p>We don&#8217;t have an exact release date available. I&#8217;m hoping it will be in the next 1-3 months<em>. </em>The SmartMouthRT SDK (Software Developer&#8217;s Kit) will be priced to reflect its greater flexibility beyond that of the Flash Extension. The first release will analyze essentially any (and all) sound playing within the Flash Player. Future releases will likely include the ability to target specific sound objects (i.e., for multiple simultaneous characters) as well as microphone objects.</p>
<p>Want an email when SmartMouthRT is available? <a title="Be among the first to know..." href="http://ajarproductions.com/newsletter/?p=subscribe&amp;id=1" target="_blank">Subscribe to our newsletter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2012/05/10/smartmouthrt-real-time-lipsyncing-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Features vs. Bandages</title>
		<link>http://ajarproductions.com/blog/2011/04/28/features-vs-bandages/</link>
		<comments>http://ajarproductions.com/blog/2011/04/28/features-vs-bandages/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 15:55:55 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=659</guid>
		<description><![CDATA[At my part time job with Pearson, I&#8217;m a member of a team that maintains a large template system for e-learning projects. This template system allows us to produce very large media-rich courses in a relatively short span of time. In these projects, as well as others, I try to teach and maintain a system [...]]]></description>
			<content:encoded><![CDATA[<p>At my part time job with Pearson, I&#8217;m a member of a team that maintains a large template system for e-learning projects. This template system allows us to produce very large media-rich courses in a relatively short span of time. In these projects, as well as others, I try to teach and maintain a system of adding features, rather than bandaging functionality that needs to change. When a client request comes in, I challenge myself and my colleagues to consider how this request could be made part of our permanent (and ongoing) system, rather jury rigging the current system to temporarily support new functionality. This feature-based approach has several long-term advantages that I will elaborate on this post.</p>
<p><span id="more-659"></span></p>
<p>What differentiates a feature from a bandage? Here are some characteristics of a feature:</p>
<ol>
<li>Can be turned on or off, usually with a single variable.</li>
<li>Does not interfere with existing functionality (i.e., when the feature is turned off, the application should function just as it did before adding the feature).</li>
<li>Easy to read code (i.e., dependent code can simply check to see if the feature is on, rather than testing several ambiguous conditions).</li>
</ol>
<p>Bandages have almost the exact opposite characteristics: can&#8217;t be easily reversed, interfere with existing functionality, and usually very difficult to read. Features also have the added advantage of being useful later. Even if you do not using the exact same code base, when your code is written as features, rather than cobbled together to serve a micro-specific purpose, it&#8217;s much easier to copy code from one project to another.</p>
<p>There are several techniques that differentiate feature-building. Consider the simple example that follows into in order to examine some of those techniques. Suppose your application includes the following 3 functions: <em>navigateTo</em>, <em>nextPage</em>, and <em>prevPage</em>. Your application plays start-to-finish automatically triggering the 3 aforementioned functions, but your client has indicated that they would like the application to pause when it reaches the end of a section. Additionally, the client wants the backward (e.g. when the user presses the back button) navigation to stop when the beginning of a section is reached.</p>
<h2>Bandage Approach</h2>
<p>First, have a look at a bandage approach. Since you know the page number that corresponds with each section, you could quickly hard-code these values into the respective functions.</p>
<p><code>function navigateTo(page) {<br />
//no change in functionality<br />
}</code></p>
<p><code>function nextPage(){<br />
if(currentPage == 11 || currentPage == 18 || currentPage == 24 || currentPage == 30) pause();<br />
else navigateTo(currentPage+1);<br />
}</code></p>
<p><code>function prevPage(){<br />
if(currentPage != 12 || currentPage != 19 || currentPage != 25 || currentPage != 31) navigateTo(currentPage-1);<br />
else /*do nothing*/;<br />
}</code></p>
<p>While this solution will work from the client&#8217;s point of view, it will get messy for you if a page needs to be added anywhere (lengthening a section and changing all of the relevant page numbers) or client decides that this feature is not needed after all. Even worse, what if the client loves it and wants more new functionality&#8230;now you&#8217;ll have to add bandages on top of bandages.</p>
<h2>Feature Approach</h2>
<p>One way to improve upon the bandage approach is to move the logic to a central location. This can be done in the example above by moving logic from the<em> nextPage</em> and <em>prevPage</em> functions to the single <em>navigateTo</em> function.</p>
<p><code>function navigateTo(page) {<br />
var sectionStart = (currentPage == 11 || currentPage == 18 || currentPage == 24 || currentPage == 30);<br />
var sectionEnd = (currentPage == 12 || currentPage == 19 || currentPage == 25 || currentPage == 31);<br />
if(sectionStart) {<br />
disableBackNav();<br />
} else if (sectionEnd) {<br />
pause();<br />
} else {<br />
//run normally<br />
}<br />
}</code></p>
<p><code>function nextPage(){<br />
navigateTo(currentPage+1);<br />
}</code></p>
<p><code>function prevPage(){<br />
navigateTo(currentPage-1);<br />
}</code></p>
<p>The purpose of this code is already slightly clearer than the bandage approach. The logic has moved out of multiple functions and into a single function that is called by the other two. Two variables are then created, <em>sectionStart</em> and <em>sectionEnd</em>, to test the location of the current page. The conditions that determine these values are adjusted based on the <em>currentPage</em> location, which will have already been altered by <em>nextPage</em> or <em>prevPage</em> (unlike the bandage example above). Additionally, the navigation will function properly even if it&#8217;s not triggered by the <em>nextPage</em> or <em>prevPage</em> functions, because all navigation is routed through <em>navigateTo</em>.</p>
<p>While jumping in with a bandage approach can seem quicker in the short run, you can see that difference in the amount of code required between these two examples is negligible. Additional improvements can be made to the code by moving the section start and end numbers out of the <em>navigateTo</em> function and to a location that is easy to find and edit (like the top of the code). Ideally, these numbers would not have to be present at all. If the data that contains page information, often stored in XML, clearly groups sections, section starts and ends can be determined dynamically, rather than hard-coding actual numbers that are likely to change.</p>
<p>A sample bit of XML might look something like this:<br />
<code>&lt;root&gt;<br />
&lt;section name='Introduction'&gt;<br />
&lt;page name='Welcome' id='010101' /&gt;<br />
&lt;page name='Course Navigation' id='010102' /&gt;<br />
&lt;page name='Initial Questions' id='010103' /&gt;<br />
&lt;/section&gt;<br />
&lt;section name='Tools'&gt;<br />
&lt;page name='Toolbar' id='010201' /&gt;<br />
&lt;page name='Calculator' id='010202' /&gt;<br />
&lt;page name='Navigation' id='01020' /&gt;<br />
&lt;page name='Selection' id='010204' /&gt;<br />
&lt;/section&gt;<br />
&lt;section name='Course Review'&gt;<br />
&lt;page name='Review Screen' id='010301' /&gt;<br />
&lt;page name='Close Course' id='010302' /&gt;<br />
&lt;page name='Submit Results' id='010303' /&gt;<br />
&lt;/section&gt;<br />
&lt;/root&gt;</code></p>
<p>As sections are added to the application structure, the application dynamically reads the section breaks from the clearly-defined XML data.</p>
<p>Further refinement would involve creation of variables like <em>pauseAtSectionEnd</em> and <em>lockBackNavAtSectionStart</em> that are set at the top of the code. Thus, each feature can easily be enabled or disabled without diving down into functions that contain other purposes. This has the additional benefit of reducing the chances that you might break something that was already working in the code, which can happen from deleting even 1 character accidentally.</p>
<p>In short, bandaging assumes on some level that you&#8217;ll never have to look at the code again&#8230;so what does it matter how organized it is, right? In my experience, this is almost never the case, bandaging will always come back to haunt the developer. Building features rather than applying bandages has made my life a lot easier as developer. Furthermore, it&#8217;s made me popular among my colleagues, because this type of code construction has facilitated easy updates and fixes when they&#8217;ve needed them in a hurry. I hope this post helps you to think about your projects in a new and helpful way.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2011/04/28/features-vs-bandages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Menu Items to Existing Menus with Adobe AIR</title>
		<link>http://ajarproductions.com/blog/2011/04/05/nativemenu-getitembyname/</link>
		<comments>http://ajarproductions.com/blog/2011/04/05/nativemenu-getitembyname/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 17:18:27 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=912</guid>
		<description><![CDATA[I&#8217;m working on a new desktop (Adobe AIR) application. More on that app in the months to come. In the process of putting together a prototype, I&#8217;ve found that NativeMenu.getItemByName doesn&#8217;t work (at least not on my system). I initially used the following code to try to add a menu item to the File menu: [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a new desktop (Adobe AIR) application. More on that app in the months to come. In the process of putting together a prototype, I&#8217;ve found that <em>NativeMenu.getItemByName</em> doesn&#8217;t work (at least not on my system). I initially used the following code to try to add a menu item to the <em>File</em> menu:</p>
<p><code>var nm:NativeMenu = NativeApplication.nativeApplication.menu;<br />
var nm0:NativeMenuItem = nm.getItemByName('File');<br />
var mi:NativeMenuItem = new NativeMenuItem("Export...");<br />
mi.addEventListener(Event.SELECT, exportSelected);<br />
nm0.submenu.addItem(mi);</code></p>
<p>Unfortunately, the menu item resolves to <em>null</em> in the above code and subsequently generates an error. Instead, I&#8217;m using the following code (that works):</p>
<p><code>var nm:NativeMenu = NativeApplication.nativeApplication.menu;<br />
var nm0:NativeMenuItem = getMenuItemByLabel(nm, 'File');<br />
var mi:NativeMenuItem = new NativeMenuItem("Export...");<br />
mi.addEventListener(Event.SELECT, exportSelected);<br />
nm0.submenu.addItem(mi);</code></p>
<p>The <em>getMenuItemByLabel</em> function is as follows:</p>
<p><code>function getMenuItemByLabel(menu:NativeMenu, labelName:String):NativeMenuItem {<br />
var count:uint = menu.items.length;<br />
for(var i:uint=0; i &lt; count; i++){<br />
var item:NativeMenuItem = menu.getItemAt(i);<br />
if(item.label === labelName) return item;<br />
}<br />
return null;<br />
}</code></p>
<p><img class="alignnone size-full wp-image-935" title="Item added to existing menu" src="http://ajarproductions.com/blog/wp-content/uploads/2011/04/air_filemenu.gif" alt="" width="213" height="68" /></p>
<p>That way I can get the menu by name and rest assured that I&#8217;ve added to the <em>File</em> menu (or any other existing menu) without having to guess its index.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2011/04/05/nativemenu-getitembyname/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MotionBrush: Free Actionscript Class</title>
		<link>http://ajarproductions.com/blog/2009/05/02/motionbrush/</link>
		<comments>http://ajarproductions.com/blog/2009/05/02/motionbrush/#comments</comments>
		<pubDate>Sat, 02 May 2009 00:43:11 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=476</guid>
		<description><![CDATA[One idea that I had when creating the MotionSketch extension was that it could be used to do write-on effects. I was going to write an Actionscript class to demo this effect prior to releasing MotionSketch but ran out of time. So I tweaked a version of vCam to quickly demo the effect for the [...]]]></description>
			<content:encoded><![CDATA[<p>One idea that I had when creating the <a href="http://ajarproductions.com/blog/2009/02/10/flash-extension-motionsketch/" target="_blank">MotionSketch</a> extension was that it could be used to do write-on effects. I was going to write an Actionscript class to demo this effect prior to releasing MotionSketch but ran out of time. So I tweaked a version of <a href="http://bryanheisey.com/blog/?p=1" target="_blank">vCam</a> to quickly demo the effect for the MotionSketch video tutorial. Thanks to a reader&#8217;s email, I was reminded that I still had yet to write this class. It&#8217;s now written and free to download. I&#8217;m calling it <em>MotionBrush</em> to keep it in the family with MotionSketch and <a href="http://ajarproductions.com/blog/2009/03/02/new-flash-extension-motionblur/" target="_blank">MotionBlur</a>. It&#8217;s super simple to use. Check out the video tutorial:</p>
<p><object width="581" height="327" data="http://vimeo.com/moogaloop.swf?clip_id=4436636&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=cccccc&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=4436636&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=cccccc&amp;fullscreen=1" /></object></p>
<p><strong><br />
Download<br />
</strong><a href="http://ajarproductions.com/projects/actionscript/MotionBrush.zip">MotionBrush.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2009/05/02/motionbrush/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>E4X &#8216;Gotcha&#8217; With XML in Actionscript 3</title>
		<link>http://ajarproductions.com/blog/2009/04/01/e4x-gotcha-with-xml-in-actionscript-3/</link>
		<comments>http://ajarproductions.com/blog/2009/04/01/e4x-gotcha-with-xml-in-actionscript-3/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 23:28:10 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[e4x]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=352</guid>
		<description><![CDATA[Oftentimes, I like to trace pieces of data as I&#8217;m programming just to make sure everything is on track. When you&#8217;re trying to trace data using E4X (XML in Actionscript 3), don&#8217;t forget the toXMLString() function. In many cases, you won&#8217;t see anything if you forget to call this function. Your code will see the [...]]]></description>
			<content:encoded><![CDATA[<p>Oftentimes, I like to trace pieces of data as I&#8217;m programming just to make sure everything is on track. When you&#8217;re trying to trace data using E4X (XML in Actionscript 3), don&#8217;t forget the <em>toXMLString()</em> function. In many cases, you won&#8217;t see anything if you forget to call this function. Your code will see the data just fine, but you might not think it&#8217;s working and spend time trying to diagnose a non-existent problem.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color:#00ccff;">trace</span><span style="color:#ccc;">&#40;</span>xml<span style="color:#ccc;">.</span><span style="color:#00ccff;">children</span><span style="color:#ccc;">&#40;</span><span style="color:#ccc;">&#41;</span><span style="color:#ccc;">&#91;</span><span style="color:#ccc;">0</span><span style="color:#ccc;">&#93;</span><span style="color:#ccc;">&#41;</span> <span style="color:#ff6600;">//empty trace</span>
<span style="color:#00ccff;">trace</span><span style="color:#ccc;">&#40;</span>xml<span style="color:#ccc;">.</span><span style="color:#00ccff;">children</span><span style="color:#ccc;">&#40;</span><span style="color:#ccc;">&#41;</span><span style="color:#ccc;">&#91;</span><span style="color:#ccc;">0</span><span style="color:#ccc;">&#93;</span><span style="color:#ccc;">.</span><span style="color:#00ccff;">toXMLString</span><span style="color:#ccc;">&#40;</span><span style="color:#ccc;">&#41;</span><span style="color:#ccc;">&#41;</span> <span style="color:#ff6600;">//now we see it!</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2009/04/01/e4x-gotcha-with-xml-in-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reduce Flash File Size by Drawing with Actionscript</title>
		<link>http://ajarproductions.com/blog/2009/03/29/reduce-flash-filesize-by-drawing-with-actionscript/</link>
		<comments>http://ajarproductions.com/blog/2009/03/29/reduce-flash-filesize-by-drawing-with-actionscript/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 01:23:21 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[size]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=447</guid>
		<description><![CDATA[Thanks to a generous donation, I've picked up a much nicer video capture application. This video tutorial shows how to translate Photoshop graphics into Actionscript using the AS3 drawing API. The resulting SWF file size is minuscule: from a 100kb Photoshop-to-Flash import to a 5kb file with some coding. I start with the most basic aspects and work up to the more complex: from a basic rectangle, to patterns from Photoshop, to complex gradients.]]></description>
			<content:encoded><![CDATA[<p>Thanks to a generous donation, I&#8217;ve picked up a much nicer <a href="http://www.shinywhitebox.com/home/home.html" target="_blank">video capture application</a>. This video tutorial shows how to translate Photoshop graphics into Actionscript using the AS3 drawing API. The resulting SWF file size is minuscule: from a 100kb Photoshop-to-Flash import to a 5kb file with some coding. I start with the most basic aspects and work up to the more complex: from a basic rectangle, to patterns from Photoshop, to complex gradients.</p>
<p>I&#8217;m pretty happy with this new software, so I&#8217;ll try to post more videos. Still working on getting better resolution out of the video host though&#8230;</p>
<p><object width="581" height="363" data="http://vimeo.com/moogaloop.swf?clip_id=3899521&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=cccccc&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=3899521&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=cccccc&amp;fullscreen=1" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2009/03/29/reduce-flash-filesize-by-drawing-with-actionscript/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>stage.width vs. stage.stageWidth in Actionscript 3</title>
		<link>http://ajarproductions.com/blog/2009/03/18/flash-stage-width-vs-stagewidth-in-actionscript-3/</link>
		<comments>http://ajarproductions.com/blog/2009/03/18/flash-stage-width-vs-stagewidth-in-actionscript-3/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 23:09:51 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[gotcha]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[stage]]></category>
		<category><![CDATA[width]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=350</guid>
		<description><![CDATA[Careful with this one. It&#8217;s easy to miss if you&#8217;re accustomed to Actionscript 1 or 2. stage.width will return the width of the content on the stage and ignore any empty pixels around the edges. So if you only have a 100 px wide rectangle on stage, your stage.width will be 100. stage.stageWidth will give [...]]]></description>
			<content:encoded><![CDATA[<p>Careful with this one. It&#8217;s easy to miss if you&#8217;re accustomed to Actionscript 1 or 2.</p>
<p><a class="lightview" href="http://ajarproductions.com/blog/wp-content/uploads/2009/03/stagewidth.gif"><img title="Stage Width Example" src="http://ajarproductions.com/blog/wp-content/uploads/2009/03/stagewidth.gif" alt="Stage Width Example" width="530" height="351" /></a></p>
<p><em>stage.width</em> will return the width of the content on the stage and ignore any empty pixels around the edges. So if you only have a 100 px wide rectangle on stage, your <em>stage.width </em>will be 100<em>.<br />
</em></p>
<p><em>stage.stageWidth</em> will give you the size of the stage, more like <em>Stage.width</em> in Actionscript 2. Use <em>stage.stageWidth</em> if you&#8217;re trying to position elements relative to the stage.</p>
<p>Same goes for <em>stage.height</em> and <em>stage.stageHeight</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2009/03/18/flash-stage-width-vs-stagewidth-in-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to Control Things with Actionscript</title>
		<link>http://ajarproductions.com/blog/2008/10/20/how-to-control-things-with-actionscript/</link>
		<comments>http://ajarproductions.com/blog/2008/10/20/how-to-control-things-with-actionscript/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 22:08:20 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=102</guid>
		<description><![CDATA[When working with other designers in Flash, I generally serve as the last line of defense for unsolved functionality mysteries. I often find that there's a mishap that has resulted from changed or lost instance names, effectively decapitating pieces of code. So how do you control things with Actionscript?]]></description>
			<content:encoded><![CDATA[<p>When working with other designers in Flash, I generally serve as the last line of defense for unsolved functionality mysteries. I often find that there&#8217;s a mishap that has resulted from changed or lost instance names, effectively decapitating pieces of code. So how do you control things with Actionscript?</p>
<p>The short answer: Instance Names.</p>
<p>For the detailed answer check out this <a href="http://ajarproductions.com/tutorials/?id=Control_Using_Actionscript1&#038;h=618">video tutorial</a> using Actionscript 3.</p>
<p>The Actionscript has to know &#8220;who&#8221; you&#8217;re wanting to talk to. Just as we know human beings by name, and talk about them and to them by name, Actionscript references objects by name. A teacher might tell &#8220;Timmy&#8221; to sit down. Accordingly, your script might tell &#8220;circle&#8221; to move 10 pixels to the left. If no symbol with the name, &#8220;circle&#8221; exists, nothing happens; just as no one sits down if there&#8217;s no &#8220;Timmy&#8221; in the classroom. </p>
<p>Referencing nested MovieClips works the same way, just add a dot inbetween:<br />
<code>var clipReference = grandparentClip.parentClip.childClip;</code></p>
<p>Remember that a symbol name is different than an instance name. You can have multiple instances of a symbol on stage, but each instance name has to be unique. Instance names are set in the Property Inspector, symbol names are set in the Library.</p>
<p>Keep this idea in mind when working with Actionscript and it will make your life a whole lot easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2008/10/20/how-to-control-things-with-actionscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash vCam Still Alive</title>
		<link>http://ajarproductions.com/blog/2008/09/12/flash-vcam-still-alive/</link>
		<comments>http://ajarproductions.com/blog/2008/09/12/flash-vcam-still-alive/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 23:47:53 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[motion]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=55</guid>
		<description><![CDATA[Check out the newest versions of this essential Flash camera tool.]]></description>
			<content:encoded><![CDATA[<p>The vCam was a camera tool for Flash created by <a href="http://weblog.motion-graphics.org/">Sham Bhangal</a>, primarily for the work of <a href="http://www.biteycastle.com">Adam Phillips</a>. It&#8217;s intuitive and easy to use, and creates some excellent effects. It appears as though it&#8217;s now being maintained by <a href="http://bryanheisey.com/blog/">Bryan Heisey</a>. Bryan&#8217;s got an <a href="http://bryanheisey.com/blog/?page_id=19">AS2 version</a>, an <a href="http://bryanheisey.com/blog/?page_id=18">AS3 version</a> for better performance, and an <a href="http://bryanheisey.com/blog/?p=12">interactive AS3 version</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2008/09/12/flash-vcam-still-alive/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Documenting Actionscript Class Libraries</title>
		<link>http://ajarproductions.com/blog/2008/02/28/documenting-actionscript-class-libraries/</link>
		<comments>http://ajarproductions.com/blog/2008/02/28/documenting-actionscript-class-libraries/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 04:05:00 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/2008/02/28/documenting-actionscript-class-libraries/</guid>
		<description><![CDATA[Over the past several months I&#8217;ve put together some rather extensive AS2 class libraries for some ongoing Flash projects. I had noticed that many of the open source libraries available on the interwebs had snazzy html documentation. Putting together this kind of documentation is not only helpful for other people using the libraries (so that [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past several months I&#8217;ve put together some rather extensive AS2 class libraries for some ongoing Flash projects. I had noticed that many of the open source libraries available on the interwebs had snazzy html documentation. Putting together this kind of documentation is not only helpful for other people using the libraries (so that they don&#8217;t have to go digging through the code), but it comes in handy when the author (me, in this case) hasn&#8217;t touched the code for a while.</p>
<p>I&#8217;m a big believer in the open-source movement and many times I&#8217;ve been able to find an open source solution that does the trick as well or better than a packaged piece of software can. So I started searching under the assumption that I would eventually settle on an open-source solution. In the case of Actionscript documentation, I found my ideal solution in <a href="http://visiblearea.com/visdoc/" target="_blank">VisDoc</a>. It was one of the few solutions that had a Graphical User Interface rather than using a command line. It produces a beautiful set of <a href="http://visiblearea.com/visdoc/examples/ActionScript2dot0/mm/documentation/html/mx_controls_MediaController.html" target="_blank">documentation files</a>. It works for both AS2 and AS3 (and Java). The one downside is that it&#8217;s Mac only. It&#8217;s not open-source, but with a sticker price of $40, it&#8217;s well worth the time saved. If you&#8217;re still looking for open-source or you need an app for your Windows machine, OSFlash has a comprehensive list of <a href="http://osflash.org/projects#documentation_systems" target="_blank">open-source documentations tools for Actionscript</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2008/02/28/documenting-actionscript-class-libraries/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

