<?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, 28 Jun 2010 02:06:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<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>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F05%2F02%2Fmotionbrush%2F&amp;title=MotionBrush%3A%20Free%20Actionscript%20Class&amp;bodytext=One%20idea%20that%20I%20had%20when%20creating%20the%20MotionSketch%20extension%20was%20that%20it%20could%20be%20used%20to%20do%20write-on%20effects.%20I%20was%20going%20to%20write%20an%20Actionscript%20class%20to%20demo%20this%20effect%20prior%20to%20releasing%20MotionSketch%20but%20ran%20out%20of%20time.%20So%20I%20tweaked%20a%20version%20" title="Digg"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F05%2F02%2Fmotionbrush%2F&amp;title=MotionBrush%3A%20Free%20Actionscript%20Class&amp;notes=One%20idea%20that%20I%20had%20when%20creating%20the%20MotionSketch%20extension%20was%20that%20it%20could%20be%20used%20to%20do%20write-on%20effects.%20I%20was%20going%20to%20write%20an%20Actionscript%20class%20to%20demo%20this%20effect%20prior%20to%20releasing%20MotionSketch%20but%20ran%20out%20of%20time.%20So%20I%20tweaked%20a%20version%20" title="del.icio.us"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=MotionBrush%3A%20Free%20Actionscript%20Class&amp;u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F05%2F02%2Fmotionbrush%2F" title="Fark"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F05%2F02%2Fmotionbrush%2F&amp;title=MotionBrush%3A%20Free%20Actionscript%20Class" title="StumbleUpon"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F05%2F02%2Fmotionbrush%2F&amp;t=MotionBrush%3A%20Free%20Actionscript%20Class" title="Facebook"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F05%2F02%2Fmotionbrush%2F&amp;title=MotionBrush%3A%20Free%20Actionscript%20Class&amp;annotation=One%20idea%20that%20I%20had%20when%20creating%20the%20MotionSketch%20extension%20was%20that%20it%20could%20be%20used%20to%20do%20write-on%20effects.%20I%20was%20going%20to%20write%20an%20Actionscript%20class%20to%20demo%20this%20effect%20prior%20to%20releasing%20MotionSketch%20but%20ran%20out%20of%20time.%20So%20I%20tweaked%20a%20version%20" title="Google Bookmarks"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F05%2F02%2Fmotionbrush%2F&amp;title=MotionBrush%3A%20Free%20Actionscript%20Class&amp;source=Ajar+Productions+Animation+%7C+Design+%7C+Development&amp;summary=One%20idea%20that%20I%20had%20when%20creating%20the%20MotionSketch%20extension%20was%20that%20it%20could%20be%20used%20to%20do%20write-on%20effects.%20I%20was%20going%20to%20write%20an%20Actionscript%20class%20to%20demo%20this%20effect%20prior%20to%20releasing%20MotionSketch%20but%20ran%20out%20of%20time.%20So%20I%20tweaked%20a%20version%20" title="LinkedIn"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F05%2F02%2Fmotionbrush%2F&amp;title=MotionBrush%3A%20Free%20Actionscript%20Class" title="Reddit"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F05%2F02%2Fmotionbrush%2F" title="Technorati"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F05%2F02%2Fmotionbrush%2F&amp;t=MotionBrush%3A%20Free%20Actionscript%20Class" title="MySpace"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=MotionBrush%3A%20Free%20Actionscript%20Class&amp;body=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F05%2F02%2Fmotionbrush%2F" title="email"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=MotionBrush%3A%20Free%20Actionscript%20Class%20-%20http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F05%2F02%2Fmotionbrush%2F" title="Twitter"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2009/05/02/motionbrush/feed/</wfw:commentRss>
		<slash:comments>11</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:#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:#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:#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>




Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F04%2F01%2Fe4x-gotcha-with-xml-in-actionscript-3%2F&amp;title=E4X%20%27Gotcha%27%20With%20XML%20in%20Actionscript%203&amp;bodytext=Oftentimes%2C%20I%20like%20to%20trace%20pieces%20of%20data%20as%20I%27m%20programming%20just%20to%20make%20sure%20everything%20is%20on%20track.%20When%20you%27re%20trying%20to%20trace%20data%20using%20E4X%20%28XML%20in%20Actionscript%203%29%2C%20don%27t%20forget%20the%20toXMLString%28%29%20function.%20In%20many%20cases%2C%20you%20won%27t%20see%20anything" title="Digg"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F04%2F01%2Fe4x-gotcha-with-xml-in-actionscript-3%2F&amp;title=E4X%20%27Gotcha%27%20With%20XML%20in%20Actionscript%203&amp;notes=Oftentimes%2C%20I%20like%20to%20trace%20pieces%20of%20data%20as%20I%27m%20programming%20just%20to%20make%20sure%20everything%20is%20on%20track.%20When%20you%27re%20trying%20to%20trace%20data%20using%20E4X%20%28XML%20in%20Actionscript%203%29%2C%20don%27t%20forget%20the%20toXMLString%28%29%20function.%20In%20many%20cases%2C%20you%20won%27t%20see%20anything" title="del.icio.us"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=E4X%20%27Gotcha%27%20With%20XML%20in%20Actionscript%203&amp;u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F04%2F01%2Fe4x-gotcha-with-xml-in-actionscript-3%2F" title="Fark"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F04%2F01%2Fe4x-gotcha-with-xml-in-actionscript-3%2F&amp;title=E4X%20%27Gotcha%27%20With%20XML%20in%20Actionscript%203" title="StumbleUpon"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F04%2F01%2Fe4x-gotcha-with-xml-in-actionscript-3%2F&amp;t=E4X%20%27Gotcha%27%20With%20XML%20in%20Actionscript%203" title="Facebook"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F04%2F01%2Fe4x-gotcha-with-xml-in-actionscript-3%2F&amp;title=E4X%20%27Gotcha%27%20With%20XML%20in%20Actionscript%203&amp;annotation=Oftentimes%2C%20I%20like%20to%20trace%20pieces%20of%20data%20as%20I%27m%20programming%20just%20to%20make%20sure%20everything%20is%20on%20track.%20When%20you%27re%20trying%20to%20trace%20data%20using%20E4X%20%28XML%20in%20Actionscript%203%29%2C%20don%27t%20forget%20the%20toXMLString%28%29%20function.%20In%20many%20cases%2C%20you%20won%27t%20see%20anything" title="Google Bookmarks"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F04%2F01%2Fe4x-gotcha-with-xml-in-actionscript-3%2F&amp;title=E4X%20%27Gotcha%27%20With%20XML%20in%20Actionscript%203&amp;source=Ajar+Productions+Animation+%7C+Design+%7C+Development&amp;summary=Oftentimes%2C%20I%20like%20to%20trace%20pieces%20of%20data%20as%20I%27m%20programming%20just%20to%20make%20sure%20everything%20is%20on%20track.%20When%20you%27re%20trying%20to%20trace%20data%20using%20E4X%20%28XML%20in%20Actionscript%203%29%2C%20don%27t%20forget%20the%20toXMLString%28%29%20function.%20In%20many%20cases%2C%20you%20won%27t%20see%20anything" title="LinkedIn"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F04%2F01%2Fe4x-gotcha-with-xml-in-actionscript-3%2F&amp;title=E4X%20%27Gotcha%27%20With%20XML%20in%20Actionscript%203" title="Reddit"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F04%2F01%2Fe4x-gotcha-with-xml-in-actionscript-3%2F" title="Technorati"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F04%2F01%2Fe4x-gotcha-with-xml-in-actionscript-3%2F&amp;t=E4X%20%27Gotcha%27%20With%20XML%20in%20Actionscript%203" title="MySpace"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=E4X%20%27Gotcha%27%20With%20XML%20in%20Actionscript%203&amp;body=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F04%2F01%2Fe4x-gotcha-with-xml-in-actionscript-3%2F" title="email"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=E4X%20%27Gotcha%27%20With%20XML%20in%20Actionscript%203%20-%20http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F04%2F01%2Fe4x-gotcha-with-xml-in-actionscript-3%2F" title="Twitter"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></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>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F29%2Freduce-flash-filesize-by-drawing-with-actionscript%2F&amp;title=Reduce%20Flash%20File%20Size%20by%20Drawing%20with%20Actionscript&amp;bodytext=Thanks%20to%20a%20generous%20donation%2C%20I%27ve%20picked%20up%20a%20much%20nicer%20video%20capture%20application.%20This%20video%20tutorial%20shows%20how%20to%20translate%20Photoshop%20graphics%20into%20Actionscript%20using%20the%20AS3%20drawing%20API.%20The%20resulting%20SWF%20file%20size%20is%20minuscule%3A%20from%20a%20100kb%20Photoshop-to-Flash%20import%20to%20a%205kb%20file%20with%20some%20coding.%20I%20start%20with%20the%20most%20basic%20aspects%20and%20work%20up%20to%20the%20more%20complex%3A%20from%20a%20basic%20rectangle%2C%20to%20patterns%20from%20Photoshop%2C%20to%20complex%20gradients." title="Digg"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F29%2Freduce-flash-filesize-by-drawing-with-actionscript%2F&amp;title=Reduce%20Flash%20File%20Size%20by%20Drawing%20with%20Actionscript&amp;notes=Thanks%20to%20a%20generous%20donation%2C%20I%27ve%20picked%20up%20a%20much%20nicer%20video%20capture%20application.%20This%20video%20tutorial%20shows%20how%20to%20translate%20Photoshop%20graphics%20into%20Actionscript%20using%20the%20AS3%20drawing%20API.%20The%20resulting%20SWF%20file%20size%20is%20minuscule%3A%20from%20a%20100kb%20Photoshop-to-Flash%20import%20to%20a%205kb%20file%20with%20some%20coding.%20I%20start%20with%20the%20most%20basic%20aspects%20and%20work%20up%20to%20the%20more%20complex%3A%20from%20a%20basic%20rectangle%2C%20to%20patterns%20from%20Photoshop%2C%20to%20complex%20gradients." title="del.icio.us"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=Reduce%20Flash%20File%20Size%20by%20Drawing%20with%20Actionscript&amp;u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F29%2Freduce-flash-filesize-by-drawing-with-actionscript%2F" title="Fark"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F29%2Freduce-flash-filesize-by-drawing-with-actionscript%2F&amp;title=Reduce%20Flash%20File%20Size%20by%20Drawing%20with%20Actionscript" title="StumbleUpon"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F29%2Freduce-flash-filesize-by-drawing-with-actionscript%2F&amp;t=Reduce%20Flash%20File%20Size%20by%20Drawing%20with%20Actionscript" title="Facebook"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F29%2Freduce-flash-filesize-by-drawing-with-actionscript%2F&amp;title=Reduce%20Flash%20File%20Size%20by%20Drawing%20with%20Actionscript&amp;annotation=Thanks%20to%20a%20generous%20donation%2C%20I%27ve%20picked%20up%20a%20much%20nicer%20video%20capture%20application.%20This%20video%20tutorial%20shows%20how%20to%20translate%20Photoshop%20graphics%20into%20Actionscript%20using%20the%20AS3%20drawing%20API.%20The%20resulting%20SWF%20file%20size%20is%20minuscule%3A%20from%20a%20100kb%20Photoshop-to-Flash%20import%20to%20a%205kb%20file%20with%20some%20coding.%20I%20start%20with%20the%20most%20basic%20aspects%20and%20work%20up%20to%20the%20more%20complex%3A%20from%20a%20basic%20rectangle%2C%20to%20patterns%20from%20Photoshop%2C%20to%20complex%20gradients." title="Google Bookmarks"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F29%2Freduce-flash-filesize-by-drawing-with-actionscript%2F&amp;title=Reduce%20Flash%20File%20Size%20by%20Drawing%20with%20Actionscript&amp;source=Ajar+Productions+Animation+%7C+Design+%7C+Development&amp;summary=Thanks%20to%20a%20generous%20donation%2C%20I%27ve%20picked%20up%20a%20much%20nicer%20video%20capture%20application.%20This%20video%20tutorial%20shows%20how%20to%20translate%20Photoshop%20graphics%20into%20Actionscript%20using%20the%20AS3%20drawing%20API.%20The%20resulting%20SWF%20file%20size%20is%20minuscule%3A%20from%20a%20100kb%20Photoshop-to-Flash%20import%20to%20a%205kb%20file%20with%20some%20coding.%20I%20start%20with%20the%20most%20basic%20aspects%20and%20work%20up%20to%20the%20more%20complex%3A%20from%20a%20basic%20rectangle%2C%20to%20patterns%20from%20Photoshop%2C%20to%20complex%20gradients." title="LinkedIn"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F29%2Freduce-flash-filesize-by-drawing-with-actionscript%2F&amp;title=Reduce%20Flash%20File%20Size%20by%20Drawing%20with%20Actionscript" title="Reddit"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F29%2Freduce-flash-filesize-by-drawing-with-actionscript%2F" title="Technorati"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F29%2Freduce-flash-filesize-by-drawing-with-actionscript%2F&amp;t=Reduce%20Flash%20File%20Size%20by%20Drawing%20with%20Actionscript" title="MySpace"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Reduce%20Flash%20File%20Size%20by%20Drawing%20with%20Actionscript&amp;body=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F29%2Freduce-flash-filesize-by-drawing-with-actionscript%2F" title="email"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Reduce%20Flash%20File%20Size%20by%20Drawing%20with%20Actionscript%20-%20http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F29%2Freduce-flash-filesize-by-drawing-with-actionscript%2F" title="Twitter"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2009/03/29/reduce-flash-filesize-by-drawing-with-actionscript/feed/</wfw:commentRss>
		<slash:comments>3</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>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F18%2Fflash-stage-width-vs-stagewidth-in-actionscript-3%2F&amp;title=stage.width%20vs.%20stage.stageWidth%20in%20Actionscript%203&amp;bodytext=Careful%20with%20this%20one.%20It%27s%20easy%20to%20miss%20if%20you%27re%20accustomed%20to%20Actionscript%201%20or%202.%0D%0A%0D%0A%0D%0A%0D%0Astage.width%20will%20return%20the%20width%20of%20the%20content%20on%20the%20stage%20and%20ignore%20any%20empty%20pixels%20around%20the%20edges.%20So%20if%20you%20only%20have%20a%20100%20px%20wide%20rectangle%20on%20st" title="Digg"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F18%2Fflash-stage-width-vs-stagewidth-in-actionscript-3%2F&amp;title=stage.width%20vs.%20stage.stageWidth%20in%20Actionscript%203&amp;notes=Careful%20with%20this%20one.%20It%27s%20easy%20to%20miss%20if%20you%27re%20accustomed%20to%20Actionscript%201%20or%202.%0D%0A%0D%0A%0D%0A%0D%0Astage.width%20will%20return%20the%20width%20of%20the%20content%20on%20the%20stage%20and%20ignore%20any%20empty%20pixels%20around%20the%20edges.%20So%20if%20you%20only%20have%20a%20100%20px%20wide%20rectangle%20on%20st" title="del.icio.us"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=stage.width%20vs.%20stage.stageWidth%20in%20Actionscript%203&amp;u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F18%2Fflash-stage-width-vs-stagewidth-in-actionscript-3%2F" title="Fark"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F18%2Fflash-stage-width-vs-stagewidth-in-actionscript-3%2F&amp;title=stage.width%20vs.%20stage.stageWidth%20in%20Actionscript%203" title="StumbleUpon"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F18%2Fflash-stage-width-vs-stagewidth-in-actionscript-3%2F&amp;t=stage.width%20vs.%20stage.stageWidth%20in%20Actionscript%203" title="Facebook"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F18%2Fflash-stage-width-vs-stagewidth-in-actionscript-3%2F&amp;title=stage.width%20vs.%20stage.stageWidth%20in%20Actionscript%203&amp;annotation=Careful%20with%20this%20one.%20It%27s%20easy%20to%20miss%20if%20you%27re%20accustomed%20to%20Actionscript%201%20or%202.%0D%0A%0D%0A%0D%0A%0D%0Astage.width%20will%20return%20the%20width%20of%20the%20content%20on%20the%20stage%20and%20ignore%20any%20empty%20pixels%20around%20the%20edges.%20So%20if%20you%20only%20have%20a%20100%20px%20wide%20rectangle%20on%20st" title="Google Bookmarks"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F18%2Fflash-stage-width-vs-stagewidth-in-actionscript-3%2F&amp;title=stage.width%20vs.%20stage.stageWidth%20in%20Actionscript%203&amp;source=Ajar+Productions+Animation+%7C+Design+%7C+Development&amp;summary=Careful%20with%20this%20one.%20It%27s%20easy%20to%20miss%20if%20you%27re%20accustomed%20to%20Actionscript%201%20or%202.%0D%0A%0D%0A%0D%0A%0D%0Astage.width%20will%20return%20the%20width%20of%20the%20content%20on%20the%20stage%20and%20ignore%20any%20empty%20pixels%20around%20the%20edges.%20So%20if%20you%20only%20have%20a%20100%20px%20wide%20rectangle%20on%20st" title="LinkedIn"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F18%2Fflash-stage-width-vs-stagewidth-in-actionscript-3%2F&amp;title=stage.width%20vs.%20stage.stageWidth%20in%20Actionscript%203" title="Reddit"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F18%2Fflash-stage-width-vs-stagewidth-in-actionscript-3%2F" title="Technorati"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F18%2Fflash-stage-width-vs-stagewidth-in-actionscript-3%2F&amp;t=stage.width%20vs.%20stage.stageWidth%20in%20Actionscript%203" title="MySpace"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=stage.width%20vs.%20stage.stageWidth%20in%20Actionscript%203&amp;body=http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F18%2Fflash-stage-width-vs-stagewidth-in-actionscript-3%2F" title="email"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=stage.width%20vs.%20stage.stageWidth%20in%20Actionscript%203%20-%20http%3A%2F%2Fajarproductions.com%2Fblog%2F2009%2F03%2F18%2Fflash-stage-width-vs-stagewidth-in-actionscript-3%2F" title="Twitter"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></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[Tutorials]]></category>
		<category><![CDATA[tips]]></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>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F10%2F20%2Fhow-to-control-things-with-actionscript%2F&amp;title=How%20to%20Control%20Things%20with%20Actionscript&amp;bodytext=When%20working%20with%20other%20designers%20in%20Flash%2C%20I%20generally%20serve%20as%20the%20last%20line%20of%20defense%20for%20unsolved%20functionality%20mysteries.%20I%20often%20find%20that%20there%27s%20a%20mishap%20that%20has%20resulted%20from%20changed%20or%20lost%20instance%20names%2C%20effectively%20decapitating%20pieces%20of%20code.%20So%20how%20do%20you%20control%20things%20with%20Actionscript%3F" title="Digg"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F10%2F20%2Fhow-to-control-things-with-actionscript%2F&amp;title=How%20to%20Control%20Things%20with%20Actionscript&amp;notes=When%20working%20with%20other%20designers%20in%20Flash%2C%20I%20generally%20serve%20as%20the%20last%20line%20of%20defense%20for%20unsolved%20functionality%20mysteries.%20I%20often%20find%20that%20there%27s%20a%20mishap%20that%20has%20resulted%20from%20changed%20or%20lost%20instance%20names%2C%20effectively%20decapitating%20pieces%20of%20code.%20So%20how%20do%20you%20control%20things%20with%20Actionscript%3F" title="del.icio.us"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=How%20to%20Control%20Things%20with%20Actionscript&amp;u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F10%2F20%2Fhow-to-control-things-with-actionscript%2F" title="Fark"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F10%2F20%2Fhow-to-control-things-with-actionscript%2F&amp;title=How%20to%20Control%20Things%20with%20Actionscript" title="StumbleUpon"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F10%2F20%2Fhow-to-control-things-with-actionscript%2F&amp;t=How%20to%20Control%20Things%20with%20Actionscript" title="Facebook"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F10%2F20%2Fhow-to-control-things-with-actionscript%2F&amp;title=How%20to%20Control%20Things%20with%20Actionscript&amp;annotation=When%20working%20with%20other%20designers%20in%20Flash%2C%20I%20generally%20serve%20as%20the%20last%20line%20of%20defense%20for%20unsolved%20functionality%20mysteries.%20I%20often%20find%20that%20there%27s%20a%20mishap%20that%20has%20resulted%20from%20changed%20or%20lost%20instance%20names%2C%20effectively%20decapitating%20pieces%20of%20code.%20So%20how%20do%20you%20control%20things%20with%20Actionscript%3F" title="Google Bookmarks"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F10%2F20%2Fhow-to-control-things-with-actionscript%2F&amp;title=How%20to%20Control%20Things%20with%20Actionscript&amp;source=Ajar+Productions+Animation+%7C+Design+%7C+Development&amp;summary=When%20working%20with%20other%20designers%20in%20Flash%2C%20I%20generally%20serve%20as%20the%20last%20line%20of%20defense%20for%20unsolved%20functionality%20mysteries.%20I%20often%20find%20that%20there%27s%20a%20mishap%20that%20has%20resulted%20from%20changed%20or%20lost%20instance%20names%2C%20effectively%20decapitating%20pieces%20of%20code.%20So%20how%20do%20you%20control%20things%20with%20Actionscript%3F" title="LinkedIn"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F10%2F20%2Fhow-to-control-things-with-actionscript%2F&amp;title=How%20to%20Control%20Things%20with%20Actionscript" title="Reddit"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F10%2F20%2Fhow-to-control-things-with-actionscript%2F" title="Technorati"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F10%2F20%2Fhow-to-control-things-with-actionscript%2F&amp;t=How%20to%20Control%20Things%20with%20Actionscript" title="MySpace"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=How%20to%20Control%20Things%20with%20Actionscript&amp;body=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F10%2F20%2Fhow-to-control-things-with-actionscript%2F" title="email"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=How%20to%20Control%20Things%20with%20Actionscript%20-%20http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F10%2F20%2Fhow-to-control-things-with-actionscript%2F" title="Twitter"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></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[Flash]]></category>
		<category><![CDATA[animation]]></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>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F09%2F12%2Fflash-vcam-still-alive%2F&amp;title=Flash%20vCam%20Still%20Alive&amp;bodytext=Check%20out%20the%20newest%20versions%20of%20this%20essential%20Flash%20camera%20tool." title="Digg"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F09%2F12%2Fflash-vcam-still-alive%2F&amp;title=Flash%20vCam%20Still%20Alive&amp;notes=Check%20out%20the%20newest%20versions%20of%20this%20essential%20Flash%20camera%20tool." title="del.icio.us"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=Flash%20vCam%20Still%20Alive&amp;u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F09%2F12%2Fflash-vcam-still-alive%2F" title="Fark"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F09%2F12%2Fflash-vcam-still-alive%2F&amp;title=Flash%20vCam%20Still%20Alive" title="StumbleUpon"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F09%2F12%2Fflash-vcam-still-alive%2F&amp;t=Flash%20vCam%20Still%20Alive" title="Facebook"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F09%2F12%2Fflash-vcam-still-alive%2F&amp;title=Flash%20vCam%20Still%20Alive&amp;annotation=Check%20out%20the%20newest%20versions%20of%20this%20essential%20Flash%20camera%20tool." title="Google Bookmarks"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F09%2F12%2Fflash-vcam-still-alive%2F&amp;title=Flash%20vCam%20Still%20Alive&amp;source=Ajar+Productions+Animation+%7C+Design+%7C+Development&amp;summary=Check%20out%20the%20newest%20versions%20of%20this%20essential%20Flash%20camera%20tool." title="LinkedIn"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F09%2F12%2Fflash-vcam-still-alive%2F&amp;title=Flash%20vCam%20Still%20Alive" title="Reddit"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F09%2F12%2Fflash-vcam-still-alive%2F" title="Technorati"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F09%2F12%2Fflash-vcam-still-alive%2F&amp;t=Flash%20vCam%20Still%20Alive" title="MySpace"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Flash%20vCam%20Still%20Alive&amp;body=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F09%2F12%2Fflash-vcam-still-alive%2F" title="email"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Flash%20vCam%20Still%20Alive%20-%20http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F09%2F12%2Fflash-vcam-still-alive%2F" title="Twitter"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></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>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F02%2F28%2Fdocumenting-actionscript-class-libraries%2F&amp;title=Documenting%20Actionscript%20Class%20Libraries&amp;bodytext=Over%20the%20past%20several%20months%20I%27ve%20put%20together%20some%20rather%20extensive%20AS2%20class%20libraries%20for%20some%20ongoing%20Flash%20projects.%20I%20had%20noticed%20that%20many%20of%20the%20open%20source%20libraries%20available%20on%20the%20interwebs%20had%20snazzy%20html%20documentation.%20Putting%20together%20" title="Digg"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F02%2F28%2Fdocumenting-actionscript-class-libraries%2F&amp;title=Documenting%20Actionscript%20Class%20Libraries&amp;notes=Over%20the%20past%20several%20months%20I%27ve%20put%20together%20some%20rather%20extensive%20AS2%20class%20libraries%20for%20some%20ongoing%20Flash%20projects.%20I%20had%20noticed%20that%20many%20of%20the%20open%20source%20libraries%20available%20on%20the%20interwebs%20had%20snazzy%20html%20documentation.%20Putting%20together%20" title="del.icio.us"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=Documenting%20Actionscript%20Class%20Libraries&amp;u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F02%2F28%2Fdocumenting-actionscript-class-libraries%2F" title="Fark"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F02%2F28%2Fdocumenting-actionscript-class-libraries%2F&amp;title=Documenting%20Actionscript%20Class%20Libraries" title="StumbleUpon"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F02%2F28%2Fdocumenting-actionscript-class-libraries%2F&amp;t=Documenting%20Actionscript%20Class%20Libraries" title="Facebook"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F02%2F28%2Fdocumenting-actionscript-class-libraries%2F&amp;title=Documenting%20Actionscript%20Class%20Libraries&amp;annotation=Over%20the%20past%20several%20months%20I%27ve%20put%20together%20some%20rather%20extensive%20AS2%20class%20libraries%20for%20some%20ongoing%20Flash%20projects.%20I%20had%20noticed%20that%20many%20of%20the%20open%20source%20libraries%20available%20on%20the%20interwebs%20had%20snazzy%20html%20documentation.%20Putting%20together%20" title="Google Bookmarks"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F02%2F28%2Fdocumenting-actionscript-class-libraries%2F&amp;title=Documenting%20Actionscript%20Class%20Libraries&amp;source=Ajar+Productions+Animation+%7C+Design+%7C+Development&amp;summary=Over%20the%20past%20several%20months%20I%27ve%20put%20together%20some%20rather%20extensive%20AS2%20class%20libraries%20for%20some%20ongoing%20Flash%20projects.%20I%20had%20noticed%20that%20many%20of%20the%20open%20source%20libraries%20available%20on%20the%20interwebs%20had%20snazzy%20html%20documentation.%20Putting%20together%20" title="LinkedIn"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F02%2F28%2Fdocumenting-actionscript-class-libraries%2F&amp;title=Documenting%20Actionscript%20Class%20Libraries" title="Reddit"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F02%2F28%2Fdocumenting-actionscript-class-libraries%2F" title="Technorati"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F02%2F28%2Fdocumenting-actionscript-class-libraries%2F&amp;t=Documenting%20Actionscript%20Class%20Libraries" title="MySpace"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Documenting%20Actionscript%20Class%20Libraries&amp;body=http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F02%2F28%2Fdocumenting-actionscript-class-libraries%2F" title="email"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Documenting%20Actionscript%20Class%20Libraries%20-%20http%3A%2F%2Fajarproductions.com%2Fblog%2F2008%2F02%2F28%2Fdocumenting-actionscript-class-libraries%2F" title="Twitter"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2008/02/28/documenting-actionscript-class-libraries/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Selling Extensibility</title>
		<link>http://ajarproductions.com/blog/2007/12/22/selling-extensibility/</link>
		<comments>http://ajarproductions.com/blog/2007/12/22/selling-extensibility/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 01:41:36 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[articles]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/2007/12/22/selling-extensibility/</guid>
		<description><![CDATA[Extensibility (from Wikipedia) &#8230; is a system design principle where the implementation takes into consideration future growth&#8230; &#8230;the design includes all of the hooks and mechanisms for expanding/enhancing the system with new capabilities without having to make major changes to the system infrastructure&#8230;.A good architecture provides the design principles to ensure this—a roadmap for that [...]]]></description>
			<content:encoded><![CDATA[<h2>Extensibility</h2>
<p>(<a href="http://en.wikipedia.org/wiki/Extensible" target="_blank">from Wikipedia)<br />
</a></p>
<p>&#8230; is a system design principle where the implementation takes into consideration future growth&#8230;</p>
<p>&#8230;the design includes all of the hooks and mechanisms for expanding/enhancing the system with new capabilities without having to make major changes to the system infrastructure&#8230;.A good architecture provides the design principles to ensure this—a roadmap for that portion of the road yet to be built&#8230;These excess capabilities are <em>not frills,</em> but are necessary for maintainability and for avoiding early obsolescence.</p>
<p>&#8230;can also mean that a software system&#8217;s behavior is modifiable at runtime, without recompiling or changing the original source code.</p>
<p>&#8212;-</p>
<p>This idea is useful when building projects that have iterations or phases.  Sometimes the client knows they&#8217;re going to want multiple versions of a given project. Realistically though, this happens all the time, even when one is working with little outside influence. An idea doesn&#8217;t usually look the same on the screen as it does in our minds or in a script. It needs tweaking and fine-tuning. As designers, we often go through myriad iterations before reaching the final product. Over time, I&#8217;ve come to realize ways to save myself future hassle by taking time upfront, at the start of a project, and planning what pieces might change how I can design them to be more flexible and more economic. This &#8216;brain-time&#8217; early on reduces the &#8216;oh crap&#8217; time later.</p>
<p><span id="more-12"></span></p>
<h2>Thinking in terms of extensibility: Grouping</h2>
<p>The simplest and earliest tricks we learn as Flash designers is to create symbols. This saves filesize because Flash only has to load each symbol once, even if it&#8217;s used a number of times. The other great advantage of using symbols is that you can edit it once and affect every instance in your file. The symbol in the library acts as a prototype, or for you philosophers out there, it&#8217;s much like a platonic form, the ethereal ideal from which all earthly instances are based. More generally, symbols could be considered to be a way of <em>grouping</em>. The group of instances has a common set of basic characteristics that are described by the symbol in the library. New characteristics can be added on top of those inherited from an instance&#8217;s group (like giving a movieClip instance a tint or changing it&#8217;s alpha on the stage).</p>
<p>Arranging problems into generic groups reduces the effort needed to solve them. Functions can be made more generic by passing in variables. Instead of writing code out for 4 tweens, why not write a tween function and pass into it the movieClip you want to tween as a variable. You can make the function more generic by passing more variables (start point, end point, duration, etc.).</p>
<p>This, taken to it&#8217;s logically conclusion, begs the question, &#8216;If I can write functions to reuse within a given file, why not write code that I can reuse for multiple files?&#8217; Enter <a href="http://en.wikipedia.org/wiki/Object-oriented_programming" target="_blank">Object-Oriented Programming </a>. Object-Oriented Programming (OOP) allows you to save code in Actionscript class files and access it from Flash by creating an instance of that class. A movieClip, for example, is an instance of the movieClip class. Each movieClip has several properties (x, y, width, height, alpha, etc.) and behaviors (onEnterFrame, onRelease, onRollOut, etc.). These properties and behaviors can be reused in a new class by <em>extending </em>the movieClip class, so that your new class will allow you add to the functionality of movieClip and will contain all the properties and methods that a movieClip does. You can also write classes from scratch. The idea, in short, is invent to the wheel <em>once</em>.</p>
<p>To learn more about OOP in Flash 8 or Flash MX 2004, check out <span class="sans"><a href="http://www.amazon.com/Object-Oriented-ActionScript-Flash-Todd-Yard/dp/1590596196/ref=pd_bbs_sr_1/002-5708333-2532813?ie=UTF8&amp;s=books&amp;qid=1183701200&amp;sr=8-1" target="_blank"><em>Object-Oriented ActionScript For Flash 8</em></a> </span>by Todd Yard and Peter Elst. A new edition for AS3 is also <a href="http://www.amazon.com/Object-Oriented-ActionScript-3-0-Todd-Yard/dp/1590598458" target="_blank">available</a>, but nearly any book on AS3 will have to address OOP. Actionscript 3 is almost entirely OOP-based, though AS2 is geared toward OOP, it is a bit more forgiving of non-OOP-based code.</p>
<h2>The Other Extensibility: &#8216;modifiable at runtime&#8217;</h2>
<p>There&#8217;s probably no better exercise for extracting information into generic groups than <a href="http://en.wikipedia.org/wiki/Xml">XML</a>. An XML document is essentially a text file, it looks a lot like HTML, except that the tags are completely made up. A tag in XML has no predefined meaning, it&#8217;s up to the application to decide what the tags mean. How&#8217;s that for generic?</p>
<p>Flash can pull data from XML at runtime. The XML can be used to swap images, swap text, and even change behaviors if the Flash file has been so setup up. That means that an SWF (Flash&#8217;s export format) can be altered without republishing from Flash or even having Flash installed! This can save tremendous amounts of time for a file that requires frequent updates and it can even empower clients to make small changes without having to come back to the designer. All because a little &#8216;brain-time&#8217; was utilized at the beginning of the project.</p>
<p>There are other methods of customizing at runtime as well. I had a project a while back that was a Flash presentation. It required an IP address specific to the location of the presentation. Since the presentation was going to be given twice at two different locations, it was assumed that a duplicate presentation would need to be made. What&#8217;s more, the IP addresses weren&#8217;t easy to find beforehand, and this customization may have to take place the day of each presentation.  I suggested instead, that a text input come up at the beginning of the presentation so that the presenter could enter the site-specific IP address, it would be stored temporarily, and later displayed in the presentation. This saved a handful of hours and a whole lot of headache, made me look like a genius, and didn&#8217;t even require that the presenter edit an XML file beforehand.</p>
<h2>The Problem with Extensibility:  Selling it to Clients</h2>
<p>Design is an expensive business. Good design is very expensive. And there&#8217;s nothing like a design budget to make a client seem stingy.  It&#8217;s a business that often requires designers to justify their existence and their rates.</p>
<p>At first blush, extensibility planning often seems like an unnecessary expense to a client, and may seem like wasted time to a novice designer/developer, but in truth, when it&#8217;s done well, it&#8217;s a no-brainer. A little brain-time upfront can save designer and client alike a whole lot of headache down the road. It ultimately tends to save money during the revision process as well. Clients (as a big amorphous group) are famous for changing their minds, and the less that you, as the designer, have to wrestle with when this occurs, the better your life will be. The trick then becomes selling it to the client at the start of the project. Some extensibility, of course, can occur without the knowledge of the client. The client doesn&#8217;t usually have to know the fine details of your library structure or coding nuisances, nor do they care. For more ambitious extensibility though, the &#8216;brain-time&#8217; will be evident in the budget.</p>
<p>Imagine you&#8217;re the first person to suggest a car without a crank. Let&#8217;s forget for a moment the awful consequences and inefficiency of a combustion engine. You&#8217;re engineering this car as a freelancer for a large auto manufacturer.  The dilemma is that it will take several extra months to engineer properly, and once it is completed, it will require a bit more testing than the existing model (because it&#8217;s new and slightly more complicated). This extra time on your behalf translates into a greater price tag for the manufacturer and hence, is significantly less attractive than the status quo. The upshot, however, is that drivers of your vehicle won&#8217;t have to crank the car (which might also prevent them from losing an arm). The appeal of this convenience compounds for drivers that live in snowy areas. Your job then (in addition to engineering the thing), is to explain to the manufacturer what this will do for their business, even though it will cost them more upfront, it will ultimately be a huge moneymaker (and may save on lawsuits from people losing their arms). This is the essence of selling extensibility.</p>
<p>The problem is that clients have extreme difficulty ignoring their immediate bottom line, even if it will dramatically improve their bottom line in the foreseeable future. We see this everywhere nowadays, a company cuts wages, not thinking they will  lose employees or hurt morale (and therefore productivity) or that the employees may not be able to afford the goods produced by their own company. It is an unfortunate consequence of unchecked capitalism, and to some degree, human nature. Understanding that, selling extensibility must be approached with patience. I&#8217;m convinced though, that the frustration of repeated explanation will be trumped by not having to go through completely avoidable and repetitive design changes. And hopefully a little &#8216;brain-time&#8217; and a little &#8216;explanation-time&#8217; will still save a whole lot of &#8216;oh-crap&#8217; time in the end.</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F12%2F22%2Fselling-extensibility%2F&amp;title=Selling%20Extensibility&amp;bodytext=%0D%0AExtensibility%0D%0A%28from%20Wikipedia%29%0D%0A%0D%0A%0D%0A...%20is%20a%20system%20design%20principle%20where%20the%20implementation%20takes%20into%20consideration%20future%20growth...%0D%0A%0D%0A...the%20design%20includes%20all%20of%20the%20hooks%20and%20mechanisms%20for%20expanding%2Fenhancing%20the%20system%20with%20new%20capabilit" title="Digg"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F12%2F22%2Fselling-extensibility%2F&amp;title=Selling%20Extensibility&amp;notes=%0D%0AExtensibility%0D%0A%28from%20Wikipedia%29%0D%0A%0D%0A%0D%0A...%20is%20a%20system%20design%20principle%20where%20the%20implementation%20takes%20into%20consideration%20future%20growth...%0D%0A%0D%0A...the%20design%20includes%20all%20of%20the%20hooks%20and%20mechanisms%20for%20expanding%2Fenhancing%20the%20system%20with%20new%20capabilit" title="del.icio.us"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=Selling%20Extensibility&amp;u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F12%2F22%2Fselling-extensibility%2F" title="Fark"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F12%2F22%2Fselling-extensibility%2F&amp;title=Selling%20Extensibility" title="StumbleUpon"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F12%2F22%2Fselling-extensibility%2F&amp;t=Selling%20Extensibility" title="Facebook"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F12%2F22%2Fselling-extensibility%2F&amp;title=Selling%20Extensibility&amp;annotation=%0D%0AExtensibility%0D%0A%28from%20Wikipedia%29%0D%0A%0D%0A%0D%0A...%20is%20a%20system%20design%20principle%20where%20the%20implementation%20takes%20into%20consideration%20future%20growth...%0D%0A%0D%0A...the%20design%20includes%20all%20of%20the%20hooks%20and%20mechanisms%20for%20expanding%2Fenhancing%20the%20system%20with%20new%20capabilit" title="Google Bookmarks"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F12%2F22%2Fselling-extensibility%2F&amp;title=Selling%20Extensibility&amp;source=Ajar+Productions+Animation+%7C+Design+%7C+Development&amp;summary=%0D%0AExtensibility%0D%0A%28from%20Wikipedia%29%0D%0A%0D%0A%0D%0A...%20is%20a%20system%20design%20principle%20where%20the%20implementation%20takes%20into%20consideration%20future%20growth...%0D%0A%0D%0A...the%20design%20includes%20all%20of%20the%20hooks%20and%20mechanisms%20for%20expanding%2Fenhancing%20the%20system%20with%20new%20capabilit" title="LinkedIn"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F12%2F22%2Fselling-extensibility%2F&amp;title=Selling%20Extensibility" title="Reddit"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F12%2F22%2Fselling-extensibility%2F" title="Technorati"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F12%2F22%2Fselling-extensibility%2F&amp;t=Selling%20Extensibility" title="MySpace"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Selling%20Extensibility&amp;body=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F12%2F22%2Fselling-extensibility%2F" title="email"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Selling%20Extensibility%20-%20http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F12%2F22%2Fselling-extensibility%2F" title="Twitter"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2007/12/22/selling-extensibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Actionscript tip: Indent large blocks of code</title>
		<link>http://ajarproductions.com/blog/2007/06/25/actionscript-tip-indent-large-blocks-of-code/</link>
		<comments>http://ajarproductions.com/blog/2007/06/25/actionscript-tip-indent-large-blocks-of-code/#comments</comments>
		<pubDate>Mon, 25 Jun 2007 02:26:26 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/2007/06/25/actionscript-tip-indent-large-blocks-of-code/</guid>
		<description><![CDATA[Much of my scripting work these days takes place outside of the Flash Actions panel, but occasionally I&#8217;ll be working inside the actions panel and want format some of my code to make it more readable. I don&#8217;t like hitting the auto-format button because it gets rid of the line breaks (thus making it less [...]]]></description>
			<content:encoded><![CDATA[<p>Much of my scripting work these days takes place outside of the Flash Actions panel, but occasionally I&#8217;ll be working inside the actions panel and want format some of my code to make it more readable. I don&#8217;t like hitting the auto-format button because it gets rid of the line breaks (thus making it less readable).</p>
<p>So when I have to indent several lines of code, I select all the lines I want to indent and hit the TAB key. You can also decrease the indent by hitting SHIFT + TAB. This also works in external editors like <a href="http://www.sephiroth.it/python/sepy.php">SE|PY</a>. It&#8217;s a little bit slower than auto-format, but it&#8217;s a lot faster than clicking and tabbing each line individually.</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F06%2F25%2Factionscript-tip-indent-large-blocks-of-code%2F&amp;title=Actionscript%20tip%3A%20Indent%20large%20blocks%20of%20code&amp;bodytext=Much%20of%20my%20scripting%20work%20these%20days%20takes%20place%20outside%20of%20the%20Flash%20Actions%20panel%2C%20but%20occasionally%20I%27ll%20be%20working%20inside%20the%20actions%20panel%20and%20want%20format%20some%20of%20my%20code%20to%20make%20it%20more%20readable.%20I%20don%27t%20like%20hitting%20the%20auto-format%20button%20becau" title="Digg"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F06%2F25%2Factionscript-tip-indent-large-blocks-of-code%2F&amp;title=Actionscript%20tip%3A%20Indent%20large%20blocks%20of%20code&amp;notes=Much%20of%20my%20scripting%20work%20these%20days%20takes%20place%20outside%20of%20the%20Flash%20Actions%20panel%2C%20but%20occasionally%20I%27ll%20be%20working%20inside%20the%20actions%20panel%20and%20want%20format%20some%20of%20my%20code%20to%20make%20it%20more%20readable.%20I%20don%27t%20like%20hitting%20the%20auto-format%20button%20becau" title="del.icio.us"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=Actionscript%20tip%3A%20Indent%20large%20blocks%20of%20code&amp;u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F06%2F25%2Factionscript-tip-indent-large-blocks-of-code%2F" title="Fark"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F06%2F25%2Factionscript-tip-indent-large-blocks-of-code%2F&amp;title=Actionscript%20tip%3A%20Indent%20large%20blocks%20of%20code" title="StumbleUpon"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F06%2F25%2Factionscript-tip-indent-large-blocks-of-code%2F&amp;t=Actionscript%20tip%3A%20Indent%20large%20blocks%20of%20code" title="Facebook"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F06%2F25%2Factionscript-tip-indent-large-blocks-of-code%2F&amp;title=Actionscript%20tip%3A%20Indent%20large%20blocks%20of%20code&amp;annotation=Much%20of%20my%20scripting%20work%20these%20days%20takes%20place%20outside%20of%20the%20Flash%20Actions%20panel%2C%20but%20occasionally%20I%27ll%20be%20working%20inside%20the%20actions%20panel%20and%20want%20format%20some%20of%20my%20code%20to%20make%20it%20more%20readable.%20I%20don%27t%20like%20hitting%20the%20auto-format%20button%20becau" title="Google Bookmarks"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F06%2F25%2Factionscript-tip-indent-large-blocks-of-code%2F&amp;title=Actionscript%20tip%3A%20Indent%20large%20blocks%20of%20code&amp;source=Ajar+Productions+Animation+%7C+Design+%7C+Development&amp;summary=Much%20of%20my%20scripting%20work%20these%20days%20takes%20place%20outside%20of%20the%20Flash%20Actions%20panel%2C%20but%20occasionally%20I%27ll%20be%20working%20inside%20the%20actions%20panel%20and%20want%20format%20some%20of%20my%20code%20to%20make%20it%20more%20readable.%20I%20don%27t%20like%20hitting%20the%20auto-format%20button%20becau" title="LinkedIn"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F06%2F25%2Factionscript-tip-indent-large-blocks-of-code%2F&amp;title=Actionscript%20tip%3A%20Indent%20large%20blocks%20of%20code" title="Reddit"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F06%2F25%2Factionscript-tip-indent-large-blocks-of-code%2F" title="Technorati"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F06%2F25%2Factionscript-tip-indent-large-blocks-of-code%2F&amp;t=Actionscript%20tip%3A%20Indent%20large%20blocks%20of%20code" title="MySpace"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Actionscript%20tip%3A%20Indent%20large%20blocks%20of%20code&amp;body=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F06%2F25%2Factionscript-tip-indent-large-blocks-of-code%2F" title="email"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Actionscript%20tip%3A%20Indent%20large%20blocks%20of%20code%20-%20http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F06%2F25%2Factionscript-tip-indent-large-blocks-of-code%2F" title="Twitter"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2007/06/25/actionscript-tip-indent-large-blocks-of-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: A Simple Preloader, in detail</title>
		<link>http://ajarproductions.com/blog/2007/02/20/tutorial-a-simple-preloader-in-detail/</link>
		<comments>http://ajarproductions.com/blog/2007/02/20/tutorial-a-simple-preloader-in-detail/#comments</comments>
		<pubDate>Tue, 20 Feb 2007 05:00:56 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/2007/02/20/tutorial-a-simple-preloader-in-detail/</guid>
		<description><![CDATA[Preloaders are one of the simplest bits of underutilized Flash programming on the web. When making any kind of presentation on the web, whether it be an interactive experience or a self-running animation, it is important to consider user experience. It is important to be generous with the user, because we ask that they be [...]]]></description>
			<content:encoded><![CDATA[<p>Preloaders are one of the simplest bits of underutilized Flash programming<br />
on the web. When making any kind of presentation on the web, whether it be<br />
an interactive experience or a self-running animation, it is important to consider<br />
user experience. It is important to be generous with the user, because we ask<br />
that they be generous with us as they view our websites. Preloaders are also<br />
important because they may retain busy or impatient users who would otherwise<br />
think that nothing is going on when the page is merely loading without giving<br />
feedback.</p>
<p>Not everybody&#8217;s a programmer, though. So I&#8217;ve provided this detailed tutorial<br />
for anyone would like to add a preloader to their Flash web project.</p>
<h3>Getting started:</h3>
<p>I usually like to put the preloader in its own scene so that it doesn&#8217;t disturb<br />
my main timeline. If you&#8217;re not familiar with using scenes in Flash, a scene<br />
can be added in the following manner:<br />
- Window &gt; Other Panels &gt; Scene<br />
- click the &#8220;+&#8221; to add a new scene<br />
- drag it to the top<br />
- and double-click to rename it<br />
- I usually name it &#8220;preloader&#8221; and from hereon out I will refer to<br />
it as the preloader scene</p>
<p>Then make sure your actionscript is organized in its own layer in the preloader<br />
scene:<br />
- add a new layer and rename it to &#8216;actions&#8217;<br />
- lock the layer so nothing accidentally get placed on the stage for this layer<br />
- select the first keyframe on the actions layer and open the actions panel<br />
- the actions panel can be opened by hitting the f9 key or by going to Window &gt; Actions</p>
<p>Then enter the following code:</p>
<div class="codeBlock"><span class="AScomment">//loaderbar_mc is a movieClip containing a rectangle with its registration point at the left edge</span><br />
<span class="AScomment">//percent_txt is a dynamic text field<br />
//note the 3 different display options (A, B, C) </span></p>
<p><span class="ASfunc">stop</span><span class="actionscript">();</span></p>
<p><span class="actionscript">loaderbar_mc.</span><span class="ASfunc">_xscale</span> <span class="actionscript">=<br />
0;</span></p>
<p><span class="ASfunc">function</span>  preloading():<span class="ASfunc">Void</span>{<br />
<span class="ASfunc">var</span>  bLoaded:<span class="ASfunc">Number</span> = <span class="ASfunc">getBytesLoaded</span>();<br />
<span class="ASfunc">var</span>  bTotal:<span class="ASfunc">Number</span> = <span class="ASfunc">getBytesTotal</span>();<br />
<span class="ASfunc">var</span>  percentL:<span class="ASfunc">Number</span> = (bLoaded / bTotal)<span class="ASfunc"> *</span> 100;</p>
<p class="ASindent"> <span class="ASfunc">if</span> (percentL <span class="ASfunc">&lt;</span> 100){<br />
<span class="AScomment">// (A) if you want to show text in the form of xx% loaded</span><br />
percent_txt.<span class="ASfunc">text</span> = <span class="ASfunc">Math</span>.<span class="ASfunc">round</span>(percentL) + <span class="ASstring">&#8220;% loaded&#8221;</span><span class="actionscript">;</span><br />
<span class="AScomment">// (B) if you want to show text in the form of xx Kb loaded/ xx Kb total </span><br />
percent_txt.<span class="ASfunc">text</span> = <span class="ASfunc">Math</span>.<span class="ASfunc">round</span>(bLoaded<span class="ASfunc">/</span>1000) <span class="ASfunc">+</span> <span class="ASstring">&#8221; Kb / &#8220;</span> <span class="ASfunc">+</span> <span class="ASfunc">Math</span>.<span class="ASfunc">round</span>(bTotal<span class="ASfunc">/</span>1000) <span class="ASfunc">+</span> <span class="ASstring">&#8221; Kb&#8221;</span> <span class="actionscript">;</span><br />
<span class="AScomment">// (C) if you want a loaderbar to grow with the % loaded </span><br />
loaderbar_mc.<span class="ASfunc">_xscale</span> = percentL;<br />
} <span class="ASfunc">else</span> {<br />
<span class="ASfunc">clearInterval</span>(loaderInterval);<br />
<span class="ASfunc">play</span>();<br />
}</p>
<p>}</p>
<p>loaderInterval = <span class="ASfunc">setInterval</span>(preloading,25);</p>
<p><span class="AScomment">//make sure there&#8217;s a stop command on your main scene if it&#8217;s a one frame app</span>
</div>
<p>Now for a detailed description of what everything does:</p>
<p><span id="more-4"></span></p>
<p class="codeBlock"><span class="ASfunc">stop</span><span class="actionscript">();</span></p>
<p>The stop() command tells the playhead to halt but allows the code on the stopped<br />
frame to run.</p>
<p class="codeBlock"><span class="actionscript">loaderbar_mc.</span><span class="ASfunc">_xscale</span> <span class="actionscript">= 0;</span></p>
<p>This code initializes the &#8216;_xscale&#8217; property of an instance with the name<br />
&#8216;loaderbar_mc&#8217; so that it has no width (because the movie has just begun loading).<br />
This is basically a rectangular movieClip. The instance name is applied via<br />
the properties inspector panel. Select the loaderbar movieClip on the stage<br />
(it needs to be in the preloader scene if you chose to do this the way I&#8217;ve<br />
listed). Make sure your symbol is a movieClip. Graphic symbols cannot have<br />
instance names and are therefore inaccessible with ActionScript.</p>
<p class="codeBlock"><span class="ASfunc">function</span> preloading():<span class="ASfunc">Void</span>{<br />
<span class="ASfunc">var</span> bLoaded:<span class="ASfunc">Number</span> = <span class="ASfunc">getBytesLoaded</span>();<br />
<span class="ASfunc">var</span> bTotal:<span class="ASfunc">Number</span> = <span class="ASfunc">getBytesTotal</span>();<br />
<span class="ASfunc">var</span> percentL:<span class="ASfunc">Number</span> = (bLoaded<span class="ASfunc"></span> bTotal) <span class="ASfunc">*</span> 100;</p>
<p>This is the beginning of a custom function that I&#8217;ve written called &#8216;preloading&#8217;.<br />
The word &#8216;function&#8217; is used to begin the function, then the function name.<br />
The parentheses are empty because no variables are being sent to the function.<br />
The word &#8216;Void&#8217; tells the application that the function is not returning any<br />
variables, and the curly bracket begins the content of the function.</p>
<p>The next 3 lines are variable declarations. The &#8216;:Number&#8217; is what&#8217;s called<br />
strict data-typing. It tells Flash that this variable should be a number. If<br />
I try to load it with a string variable (&#8220;atom&#8221; for instance) or<br />
a boolean value (TRUE or FALSE), Flash will report an error in the output panel.</p>
<p>The first variable retrieves the bytes loaded by Flash, the second retrieves<br />
the total bytes, and the third divides the current loaded bytes by the total<br />
bytes to get a percentage (multiplying by 100 gets it into the form we&#8217;re used<br />
to, like 56 instead of .56&#8211;we&#8217;ll add the percent sign next).</p>
<p class="codeBlock"><span class="ASfunc">if</span> (percentL <span class="ASfunc">&lt;</span> 100){<br />
<span class="AScomment">// (A) if you want to show text in the form of xx% loaded</span><br />
percent_txt.<span class="ASfunc">text</span> = <span class="ASfunc">Math</span>.<span class="ASfunc">round</span>(percentL) + <span class="ASstring">&#8220;% loaded&#8221;</span><span class="actionscript">;</span><br />
<span class="AScomment">// (B) if you want to show text in the form of xx Kb loaded/ xx Kb total </span><br />
percent_txt.<span class="ASfunc">text</span> = <span class="ASfunc">Math</span>.<span class="ASfunc">round</span>(bLoaded<span class="ASfunc">/</span>1000) <span class="ASfunc">+</span> <span class="ASstring">&#8221; Kb / &#8220;</span> <span class="ASfunc">+</span> <span class="ASfunc">Math</span>.<span class="ASfunc">round</span>(bTotal<span class="ASfunc">/</span>1000) <span class="ASfunc">+</span> <span class="ASstring">&#8221; Kb&#8221;</span> <span class="actionscript">;</span><br />
<span class="AScomment">// (C) if you want a loaderbar to grow with the % loaded </span><br />
loaderbar_mc.<span class="ASfunc">_xscale</span> = percentL;<br />
}</p>
<p>This next block is an &#8216;if&#8217; statement. The content of the if statement is contained<br />
in curly brackets just like our function (which we are still inside). The code<br />
inside the parentheses is the statement that drives this command; as long as<br />
it&#8217;s true, the lines inside the if statement&#8217;s curly brackets will continue<br />
to run. In this case it&#8217;s checking to see if the percentL variable we created<br />
in the previous line is less than 100.</p>
<p>The lines that begin with &#8216;//&#8217; are merely comments for reference, they have no affect on the code. They represent 3 different<br />
options I have provided for displaying feedback to the user. They can be used<br />
seperately or in combination. Make sure to delete the items you don&#8217;t use or<br />
comment them out by adding two slashes (&#8216;//&#8217;) at the beginning of the line.<br />
The &#8216;percent_txt&#8217; refers to a dynamic text box on the stage with the instance<br />
name &#8216;percent_txt.&#8217; This text box must be set to &#8216;Dynamic text&#8217; in the Property<br />
Inspector to give it an instance name that we can reference with ActionScript.<br />
I usually choose a web font (verdana or arial) and select &#8216;Use device fonts&#8217;<br />
from the Property Inspector. This utilizes the user&#8217;s own fonts and keeps the<br />
Flash file size low. The alternative is embedding a font, and depending on<br />
the font, that can add a lot of girth to an swf.</p>
<p>The first two options (A and B) are merely  concatenations (lumping bits together<br />
into a string of text). I use Flash&#8217;s built-in Math.round function to round<br />
to whole numbers for a less cluttered display. The third option (C) uses the<br />
&#8216;percentL&#8217; variable that was created earlier to determine the size of our loaderbar_mc<br />
movieClip, hence the loaderbar will seem to grow.</p>
<p>Finally we close out the &#8216;if&#8217; statement with a curly brace.</p>
<p class="codeBlock"> <span class="ASfunc">else</span> {<br />
<span class="ASfunc">clearInterval</span>(loaderInterval);<br />
<span class="ASfunc">play</span>();<br />
}</p>
<p>Next, we use an &#8216;else&#8217; statement to clear the &#8216;loaderInterval&#8217; (which I&#8217;ll<br />
explain in a second), and play() the main timeline (i.e., start the movie).<br />
The else statement is what gets called when the condition within the if statement<br />
(percentL &lt; 100), is no longer true (because the movie is completely loaded,<br />
100%).</p>
<p class="codeBlock">}<br />
loaderInterval = <span class="ASfunc">setInterval</span>(preloading,25);</p>
<p>Finally we close out the function with a curly bracket and we&#8217;ve come to the<br />
interval. An interval is something that occurs repeatedly until it&#8217;s cleared.<br />
This is an alternative to using &#8216;onEnterFrame.&#8217; I&#8217;ve stopped using onEnterFrame<br />
because I like the versatility of using intervals.</p>
<p>This bit of code actually gets called before the &#8216;preloading&#8217; function, because<br />
a function must be <em>called</em>  in order to run. In this case the preloading<br />
function is getting called every 25 milliseconds or 40 times/second. This allows<br />
for smooth animation of the loaderbar even if the swf is only set to 12 frames/second.<br />
Whereas, onEnterFrame will only run at the document&#8217;s  frame rate.</p>
<p>First we need to declare<br />
the interval with a variable name so that it can be referenced and cleared<br />
in our &#8216;else&#8217; statement, hence &#8216;loaderInterval.&#8217; Next we use the setInterval<br />
function and two of its paramenters to call the preloading function from above<br />
every 25 milliseconds. That means that &#8216;preloading&#8217; will be called over and<br />
over until the percentL variable reaches 100.</p>
<p>Clearing the interval is important<br />
because it is memory intensive to have the user&#8217;s CPU calling a function over<br />
and over, especially when other things are occurring within the swf. That&#8217;s<br />
why we clear the loaderInterval once we&#8217;re done using it. I called this variable<br />
&#8216;loaderInterval&#8217; because that&#8217;s its purpose in this code, but an interval can<br />
be named just about anything.</p>
<h3>Testing The Preloader</h3>
<p>To test your movie go to Control &gt; Test Movie. You&#8217;ll notice the preloader<br />
scene shows very quickly if at all. That&#8217;s because we&#8217;re testing it locally.<br />
To see what it would look like in action go to View &gt; Simulate Download. You<br />
can change the speed of the connection that&#8217;s being simulated by going to View<br />
&gt; Download settings and selecting a different speed.</p>
<p>That&#8217;s it!</p>
<p>A quick note:<br />
This preloader code is designed for ActionScript 2 (Macromedia Flash MX 2004<br />
or later, Flash player 6/7 or later). To make this code function in ActionScript<br />
1,  remove all of the strict data-typing (basically everything beginning<br />
with a colon&#8211;:Number and :Void).</p>
<p>Happy Flashing!</p>
<p>-Justin</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F02%2F20%2Ftutorial-a-simple-preloader-in-detail%2F&amp;title=Tutorial%3A%20A%20Simple%20Preloader%2C%20in%20detail&amp;bodytext=Preloaders%20are%20one%20of%20the%20simplest%20bits%20of%20underutilized%20Flash%20programming%0D%0Aon%20the%20web.%20When%20making%20any%20kind%20of%20presentation%20on%20the%20web%2C%20whether%20it%20be%0D%0Aan%20interactive%20experience%20or%20a%20self-running%20animation%2C%20it%20is%20important%20to%20consider%0D%0Auser%20experienc" title="Digg"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F02%2F20%2Ftutorial-a-simple-preloader-in-detail%2F&amp;title=Tutorial%3A%20A%20Simple%20Preloader%2C%20in%20detail&amp;notes=Preloaders%20are%20one%20of%20the%20simplest%20bits%20of%20underutilized%20Flash%20programming%0D%0Aon%20the%20web.%20When%20making%20any%20kind%20of%20presentation%20on%20the%20web%2C%20whether%20it%20be%0D%0Aan%20interactive%20experience%20or%20a%20self-running%20animation%2C%20it%20is%20important%20to%20consider%0D%0Auser%20experienc" title="del.icio.us"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=Tutorial%3A%20A%20Simple%20Preloader%2C%20in%20detail&amp;u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F02%2F20%2Ftutorial-a-simple-preloader-in-detail%2F" title="Fark"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F02%2F20%2Ftutorial-a-simple-preloader-in-detail%2F&amp;title=Tutorial%3A%20A%20Simple%20Preloader%2C%20in%20detail" title="StumbleUpon"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F02%2F20%2Ftutorial-a-simple-preloader-in-detail%2F&amp;t=Tutorial%3A%20A%20Simple%20Preloader%2C%20in%20detail" title="Facebook"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F02%2F20%2Ftutorial-a-simple-preloader-in-detail%2F&amp;title=Tutorial%3A%20A%20Simple%20Preloader%2C%20in%20detail&amp;annotation=Preloaders%20are%20one%20of%20the%20simplest%20bits%20of%20underutilized%20Flash%20programming%0D%0Aon%20the%20web.%20When%20making%20any%20kind%20of%20presentation%20on%20the%20web%2C%20whether%20it%20be%0D%0Aan%20interactive%20experience%20or%20a%20self-running%20animation%2C%20it%20is%20important%20to%20consider%0D%0Auser%20experienc" title="Google Bookmarks"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F02%2F20%2Ftutorial-a-simple-preloader-in-detail%2F&amp;title=Tutorial%3A%20A%20Simple%20Preloader%2C%20in%20detail&amp;source=Ajar+Productions+Animation+%7C+Design+%7C+Development&amp;summary=Preloaders%20are%20one%20of%20the%20simplest%20bits%20of%20underutilized%20Flash%20programming%0D%0Aon%20the%20web.%20When%20making%20any%20kind%20of%20presentation%20on%20the%20web%2C%20whether%20it%20be%0D%0Aan%20interactive%20experience%20or%20a%20self-running%20animation%2C%20it%20is%20important%20to%20consider%0D%0Auser%20experienc" title="LinkedIn"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F02%2F20%2Ftutorial-a-simple-preloader-in-detail%2F&amp;title=Tutorial%3A%20A%20Simple%20Preloader%2C%20in%20detail" title="Reddit"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F02%2F20%2Ftutorial-a-simple-preloader-in-detail%2F" title="Technorati"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F02%2F20%2Ftutorial-a-simple-preloader-in-detail%2F&amp;t=Tutorial%3A%20A%20Simple%20Preloader%2C%20in%20detail" title="MySpace"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Tutorial%3A%20A%20Simple%20Preloader%2C%20in%20detail&amp;body=http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F02%2F20%2Ftutorial-a-simple-preloader-in-detail%2F" title="email"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Tutorial%3A%20A%20Simple%20Preloader%2C%20in%20detail%20-%20http%3A%2F%2Fajarproductions.com%2Fblog%2F2007%2F02%2F20%2Ftutorial-a-simple-preloader-in-detail%2F" title="Twitter"><img src="http://ajarproductions.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2007/02/20/tutorial-a-simple-preloader-in-detail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
