<?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>Flash Speaks Actionscript &#187; Beginner</title>
	<atom:link href="http://flashspeaksactionscript.com/tag/beginner/feed/" rel="self" type="application/rss+xml" />
	<link>http://flashspeaksactionscript.com</link>
	<description>Learn and Speak Actionscript</description>
	<lastBuildDate>Sat, 28 Jan 2012 03:11:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>ActionScript 1:1 &#8211; Getting Intimate With ActionScript 3.0</title>
		<link>http://flashspeaksactionscript.com/actionscript-11-getting-intimate-with-actionscript-30/</link>
		<comments>http://flashspeaksactionscript.com/actionscript-11-getting-intimate-with-actionscript-30/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 12:00:20 +0000</pubDate>
		<dc:creator>Angel Romero</dc:creator>
				<category><![CDATA[AS2 to AS3]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Flash CS4]]></category>
		<category><![CDATA[roundup]]></category>
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://flashspeaksactionscript.com/?p=3730</guid>
		<description><![CDATA[Struggling to get our foot off the ground with getting more intimate with ActionScript 3.0?  Doug Winnie has kicked off a series, ActionScript 1:1, which are designed for animators and designers using Flash CS4 who want to take their work to the next level but need some guidance adding custom interactivity using ActionScript 3.0.]]></description>
			<content:encoded><![CDATA[<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fflashspeaksactionscript.com%252Factionscript-11-getting-intimate-with-actionscript-30%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22ActionScript%201%3A1%20-%20Getting%20Intimate%20With%20ActionScript%203.0%20%23AS2%20to%20AS3%20%23AS3%20%23Beginner%20%23Flash%20CS4%20%23roundup%20%23Videos%22%20%7D);"></div>
<p><strong><em>Struggling to get our foot off the ground with getting more intimate with ActionScript 3.0?</em></strong></p>
<p><a title="1:1 with Doug Winnie" href="http://www.adobe.dougwinnie.com/">Doug Winnie</a> has kicked off a series, <strong>ActionScript 1:1</strong>, which is designed for animators and designers using Flash CS4 who want to take their work to the next level but need some guidance adding custom interactivity using ActionScript 3.0.</p>
<p>These videos are aimed at Flash Designers looking to strengthen their knowledge of ActionScript 3.0.  We all have to start somewhere when learning to use ActionScript 3.0 and this series is great way to get that train moving along.</p>
<p>Below are all the episodes in the series.  You can also find Doug&#8217;s videos as a channel on <a title="Adobe TV" href="http://tv.adobe.com/#vi+f15914v1000">Adobe TV</a> and <a title="iTunes" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?i=54734103&amp;id=315640748">iTunes</a>.  Enjoy!</p>
<h2>Welcome to ActionScript 3</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1000"><img class="size-full wp-image-3744 alignnone" title="Welcome to ActionScript 3.0" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/why-actionscript-3.png" alt="Welcome to ActionScript 3.0" width="500" height="280" /></a></p>
<p>Doug Winnie gives an overview of his new series in which you will learn the fundamentals of ActionScript 3.0. Get up and running in Flash Professional using ActionScript 3.0.</p>
<h2>Working with the Actions Panel</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1003"><img class="size-full wp-image-3745 alignnone" title="Working with the ActionScript Panel" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/working-actionscript-panel.png" alt="Working with the ActionScript Panel" width="500" height="280" /></a></p>
<p>Understand how to use the Actions panel and use the trace statement. Doug Winnie walks you through the code to control objects created in Flash.</p>
<h2>Accessing Object Parameters</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1001"><img class="alignnone size-full wp-image-3733" title="Accessing Object Parameters" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/accessing-object-parameters.png" alt="Accessing Object Parameters" width="500" height="280" /></a></p>
<p>Doug Winnie demonstrates how to access properties of an object such as size and location by using instance properties with ActionScript, sending messages to the output console.</p>
<h2>Changing Object Parameters</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1002"><img class="alignnone size-full wp-image-3735" title="Changing Object Parameters" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/changing-object-parameters.png" alt="Changing Object Parameters" width="500" height="280" /></a></p>
<p>In order to manipulate objects, Doug Winnie uses the assignment operator in ActionScript 3.0 to instantaneously overwrite values initially assigned in Flash.</p>
<h2>Exploring Named Library Assets</h2>
<p><img class="alignnone size-full wp-image-3739" title="Exploring Named Library Assets" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/exploring-named-lbrary-assets.png" alt="Exploring Named Library Assets" width="500" height="280" /></p>
<p>Dive deeper with the Library panel and learn more about how to name instances on the stage, and how to use the Linkage panel to name objects in the Library panel.</p>
<h2>Adding Named Objects to the Stage</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1005"><img class="alignnone size-full wp-image-3734" title="Adding Named Objects to the Stage  // Image" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/adding-named-objects-stage.png" alt="Adding Named Objects to the Stage  // Image" width="500" height="280" /></a></p>
<p>In this video, Doug Winnie teaches you how to use ActionScript to dynamically add objects to the stage using code and the DisplayStack.</p>
<h2>Working with Comments</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1004"><img class="alignnone size-full wp-image-3731" title="Working with Comments" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/working-with-comments.png" alt="Working with Comments" width="500" height="280" /></a></p>
<p>You can use comments to document your ActionScript code for other Developers to use. Doug&#8217;s tutorial sums up the benefit of building up good coding practices.</p>
<h2>Fundamentals of Functions</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1007"><img class="alignnone size-full wp-image-3740" title="Fundamentals of Functions" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/fundamentals-of-functions.png" alt="Fundamentals of Functions" width="500" height="280" /></a></p>
<p>Doug Winnie provides an introduction to functions and explains how to efficiently use them in ActionScript by grouping commonly used tasks together as a named function.</p>
<h2>Accepting Values in Functions</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1008"><img class="alignnone size-full wp-image-3732" title="Accepting Values in Functions" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/accepting-values-in-functions.png" alt="Accepting Values in Functions" width="500" height="280" /></a></p>
<p>Doug continues his tutorial on how to efficiently use functions with ActionScript. With functions you can customize their functionality by assigning parameters and values.</p>
<h2>Returning Values from Functions</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1009"><img class="alignnone size-full wp-image-3743" title="Returning Values from Functions" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/returning-values-functions.png" alt="Returning Values from Functions" width="500" height="280" /></a></p>
<p>Doug Winnie wraps up his lesson on functions by explaining how to retrieve results for the output panel with the return statement.</p>
<h2>Mathematical Operators</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1010"><img class="alignnone size-full wp-image-3741" title="Mathematical Operators" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/mathematical-operators.png" alt="Mathematical Operators" width="500" height="280" /></a></p>
<p>Doug Winnie teaches the basics of calculating mathematical operations in ActionScript code, including commonly used shortcuts to save coding time.</p>
<h2>Order of Mathematical Operations</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1011"><img class="alignnone size-full wp-image-3742" title="Order of Mathematical Operations" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/order-mathematical-operators.png" alt="Order of Mathematical Operations" width="500" height="280" /></a></p>
<p>In this video, Doug Winnie reviews how Flash calculates math based on a specific order of operations.</p>
<h2>Events and MouseEvent Handlers</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1012"><img class="alignnone size-full wp-image-3738" title="Events and MouseEvent Handlers" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/events-mouseevents-handlers.png" alt="Events and MouseEvent Handlers" width="500" height="280" /></a></p>
<p>Discover the power of events and how you can quickly and easily build event handlers. In this episode, Doug covers how to use events to build interactivity with the mouse.</p>
<h2>Create a Timer</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1013"><img class="alignnone size-full wp-image-3737" title="Create a Timer" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/create-a-timer.png" alt="Create a Timer" width="500" height="280" /></a></p>
<p>Using your advanced knowledge of ActionScript, Doug Winnie walks you through on how to combine time events with event listeners to create and control time-based events.</p>
<h2>Create a Clock</h2>
<p><a href="http://tv.adobe.com/#vi+f15914v1014"><img class="alignnone size-full wp-image-3736" title="Create a Clock" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/08/create-a-clock.png" alt="Create a Clock" width="500" height="280" /></a></p>
<p>See Doug build a clock in Flash using ActionScript to manipulate objects&#8217; properties and add mouse and timer events. Everything you&#8217;ve learned from his tutorials is combined into one project.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashspeaksactionscript.com/actionscript-11-getting-intimate-with-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Smart SWF Optimization with Custom Framerates</title>
		<link>http://flashspeaksactionscript.com/smart-swf-optimization-with-custom-framerates/</link>
		<comments>http://flashspeaksactionscript.com/smart-swf-optimization-with-custom-framerates/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 13:00:41 +0000</pubDate>
		<dc:creator>Angel Romero</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[framerate]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://flashspeaksactionscript.com/?p=3664</guid>
		<description><![CDATA[Over the years, the Flash Player has received such a bad rep for hogging computer system resources even while displaying static content. There were many times in which I would wonder <em>"What the heck is Flash processing?"</em>. As for Flash Developers/Designers, there was only so much we can do to optimize the SWF via runtime. That was then, this is now!]]></description>
			<content:encoded><![CDATA[<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fflashspeaksactionscript.com%252Fsmart-swf-optimization-with-custom-framerates%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Smart%20SWF%20Optimization%20with%20Custom%20Framerates%20%23AS3%20%23Beginner%20%23framerate%20%23optimization%20%23Tutorial%20%23Videos%22%20%7D);"></div>
<p>Over the years, the Flash Player has received such a bad rep for hogging computer system resources even while displaying static content. There were many times in which I would wonder <em>&#8220;What the heck is Flash processing?&#8221;</em>. As for Flash Developers/Designers, there was only so much we can do to optimize the SWF via runtime. That was then, this is now! In Lee&#8217;s latest video tutorial, he demonstrates how you can <a title="New tutorial on SWF framerate optimization " href="http://theflashblog.com/?p=1138" target="_blank">dynamically change your movie&#8217;s framerate</a> to use only the resources it needs.</p>
<p>With its introduction in AS3, you can dynamically change the framerate of your SWF movie. In an earlier tutorial, I demonstrated how you can <a title="Dynamically Adjust the Frame Rate of a Flash Animation" href="http://flashspeaksactionscript.com/dynamically-adjust-the-frame-rate-of-a-flash-animation/" target="_self">change the framerate of your SWF</a> and how it will effect a frame by frame animation.</p>
<p>By leveraging the ability to dynamically change the framerate of your SWF, it will allow you to take advantage of idle moments in your Flash applications by changing the the framerate based on the content being displayed. It&#8217;s a simple, yet great concept.</p>
<p>Check out Lee&#8217;s video, <a title="SWF Framerate Optimization" href="http://www.gotoandlearn.com/play.php?id=112" target="_blank">SWF Framerate Optimization</a>, to learn more on how to implement such a concept. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://flashspeaksactionscript.com/smart-swf-optimization-with-custom-framerates/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Build Your First Facebook Application</title>
		<link>http://flashspeaksactionscript.com/build-your-first-facebook-application/</link>
		<comments>http://flashspeaksactionscript.com/build-your-first-facebook-application/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 19:00:27 +0000</pubDate>
		<dc:creator>Angel Romero</dc:creator>
				<category><![CDATA[Videos]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[flex tutorial]]></category>

		<guid isPermaLink="false">http://flashspeaksactionscript.com/?p=3419</guid>
		<description><![CDATA[In this video, Daniel Dura shows you how to use Flex Builder to develop your first Flash application on the Facebook Platform using the ActionScript 3.0 Client Library for Facebook Platform API.  The video is about 12 minutes long and if you've got the time you should definitely check it out.]]></description>
			<content:encoded><![CDATA[<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fflashspeaksactionscript.com%252Fbuild-your-first-facebook-application%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Build%20Your%20First%20Facebook%20Application%20%23Beginner%20%23Facebook%20%23flex%20tutorial%20%23Videos%22%20%7D);"></div>
<p>Last week&#8217;s announcement of <a title="Adobe Releases the New AS3 Facebook API" href="http://flashspeaksactionscript.com/adobe-releases-the-new-as3-facebook-api/" target="_blank">Adobe&#8217;s releasing of the new AS3 Facebook API</a> definitely brought upon a cheerful buzz within the Flash/Flex community.  So, now that there is a new look to the AS3 Facebook API, I am sure many of you would like to take a deeper look into how you can take advantage of this new library in your Flash/Flex projects.</p>
<p>In this video, <a title="All About the Adobe Flash Platform" href="http://www.danieldura.com/" target="_blank">Daniel Dura</a> shows you how to use Flex Builder to develop your first Flash application on the Facebook Platform using the ActionScript 3.0 Client Library for Facebook Platform API.  The video is about <a title="Build your first Facebook application" href="http://www.adobe.com/devnet/facebook/articles/video_facebook_quick_start.html" target="_blank">12 minutes long</a> and if you&#8217;ve got the time you should definitely check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashspeaksactionscript.com/build-your-first-facebook-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Moving From AS2 to AS3: Creating Dynamic Masks</title>
		<link>http://flashspeaksactionscript.com/moving-from-as2-to-as3-creating-dynamic-masks/</link>
		<comments>http://flashspeaksactionscript.com/moving-from-as2-to-as3-creating-dynamic-masks/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 18:00:21 +0000</pubDate>
		<dc:creator>Angel Romero</dc:creator>
				<category><![CDATA[AS2 to AS3]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[masking]]></category>

		<guid isPermaLink="false">http://flashspeaksactionscript.com/?p=3396</guid>
		<description><![CDATA[Dynamic mask objects have been key to many Flash project's success. When it comes to migrating over from AS2 to AS3, you'll find that things have changed as the method "setMask()" in AS2 is now a property called "mask".   In this next edition of the Moving From AS2 to AS3 series, I will be comparing the two solutions and offering an efficient solution to creating dynamic masks using AS3.]]></description>
			<content:encoded><![CDATA[<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fflashspeaksactionscript.com%252Fmoving-from-as2-to-as3-creating-dynamic-masks%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Moving%20From%20AS2%20to%20AS3%3A%20Creating%20Dynamic%20Masks%20%23AS2%20to%20AS3%20%23AS3%20%23Beginner%20%23masking%22%20%7D);"></div>
<p>Dynamic mask objects have been key to many Flash project&#8217;s success. When it comes to migrating over from AS2 to AS3, you&#8217;ll find that things have changed as the method &#8220;setMask()&#8221; in AS2 is now a property called &#8220;mask&#8221;. In this next edition of the <a title="Moving From AS2 to AS3: A Handy List of Resources" href="http://flashspeaksactionscript.com/as2-to-as3-handy-list-of-resources/" target="_self">Moving From AS2 to AS3 series</a>, I will be comparing the two solutions and offering an efficient solution to creating dynamic masks using AS3.</p>
<h2>Comparing AS2 to AS3</h2>
<h3>Setting masks dynamically using ActionScript 2.0</h3>
<pre class="brush: as3; title: ; notranslate">myMC.setMask(maskObject);</pre>
<h3>Setting masks dynamically using ActionScript 3.0</h3>
<pre class="brush: as3; title: ; notranslate">myMC.mask = maskObject;</pre>
<p>So as you can see the syntax hasn&#8217;t changed much, however, personally I feel that AS3&#8242;s implementation is a bit more literal making it easier to understand.</p>
<h2>Creating your masking objects as Sprites</h2>
<p>While in ActionScript 2.0 there was no better of a solution than to create your masking object as a MovieClip. With the introduction of the Sprite object in ActionScript 3.0, creating your masking objects as Sprites is a far more efficient solution.</p>
<p>Since a mask object does not require a timeline, using a Sprite instead of a MovieClip simply makes more sense. Below is an example where a Sprite is used in place of a MovieClip:</p>
<pre class="brush: as3; title: ; notranslate">// Create mask
var maskObject:Sprite = new Sprite();
maskObject.graphics.beginFill(0xFF0000);
maskObject.graphics.drawRoundRect(myMC.x, myMC.y, 453, 290, 20);

// Apply mask
myMC.mask = maskObject;</pre>
<h3><a title="Download Example File" href="http://flashspeaksactionscript.com/files/dynamic-masks-as3/dynamic-mask-as3.zip" target="_blank">Download Example File</a></h3>
<p><em>I hope this helps in your migration over into  AS3.  If there is something in particular you want to add or see with the Moving From AS2 to AS3 series, feel free to contact me via the <a title="Contact Us" href="../contact/" target="_self">contact page</a>. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://flashspeaksactionscript.com/moving-from-as2-to-as3-creating-dynamic-masks/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Moving From AS2 to AS3: Handling Depths</title>
		<link>http://flashspeaksactionscript.com/moving-from-as2-to-as3-handling-depths/</link>
		<comments>http://flashspeaksactionscript.com/moving-from-as2-to-as3-handling-depths/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 16:00:25 +0000</pubDate>
		<dc:creator>Angel Romero</dc:creator>
				<category><![CDATA[AS2 to AS3]]></category>
		<category><![CDATA[Beginner]]></category>

		<guid isPermaLink="false">http://flashspeaksactionscript.com/?p=3371</guid>
		<description><![CDATA[Managing depths in AS2 was pretty annoying and time consuming. You'd spend so much time dedicating depth ranges for MovieClip groups, but in the end the limitations of AS2 really got the last laugh. Who's laughing now?]]></description>
			<content:encoded><![CDATA[<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fflashspeaksactionscript.com%252Fmoving-from-as2-to-as3-handling-depths%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Moving%20From%20AS2%20to%20AS3%3A%20Handling%20Depths%20%23AS2%20to%20AS3%20%23Beginner%22%20%7D);"></div>
<p>Managing depths in AS2 was pretty annoying and time consuming.  You&#8217;d spend so much time dedicating depth ranges for MovieClip groups, but in the end the limitations of AS2 really got the last laugh.  Who&#8217;s laughing now?</p>
<h2>Improving upon handling depths</h2>
<p>With the introduction of Flash Player 9 and ActionScript 3.0, Adobe created an easy and powerful way to add, remove, and change MovieClips on the screen. It&#8217;s is called the display list.</p>
<h2>Understanding the Display List</h2>
<p>Basically, the role of the display list is to handle managing where your MovieClips are placed in depth when visually adding them to the Flash stage.  To learn more on this topic, the Yahoo Flash Developer  has a thorough introduction article to <a title="Introduction to the Display List" href="http://developer.yahoo.com/flash/articles/display-list.html" target="_blank">understanding the display list</a>.</p>
<h2>What happened to swapDepths and getNextHighestDepth?</h2>
<p>The <strong>swapDepths()</strong> and <strong>getNextHighestDepth()</strong> methods no longer exist in ActionScript 3.0.  Instead you would rely using the <a title="ActionScript 3.0 Language and Components Reference" href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/DisplayObjectContainer.html" target="_blank">DisplayObjectContainer</a> methods associated with a MovieClip added to the display list.</p>
<h2>Swapping depths using AS2</h2>
<pre class="brush: as3; title: ; notranslate">function arrangeBoxes():Void {
    for (var i:Number = 0; i &lt; 3; i++) {
        //Attaching the MC from th library for the duration of the loop
        var box:MovieClip = this.attachMovie(&quot;box&quot;, &quot;box&quot; + i + &quot;_mc&quot;, this.getNextHighestDepth(), {_x: ((i * 80) + 100), _y: 100});
        var boxColor:Color=new Color(box);
        boxColor.setRGB(Math.random() * 0xFFFFFF);
        box.onRollOver = function():Void
        {
        //Focused box will achieve to the next highest depth
        this.swapDepths(this._parent.getNextHighestDepth());
        };
    }
}
arrangeBoxes();</pre>
<p>If you noticed in the AS2 solution, we are basically making the interacted object obtain the next highest depth available on the stage.  Sounds correct and automated but there is nothing really stopping this from reaching a depth of 9999 with only 3 objects on stage.  Basically, this is no where near an efficient solution to depth swapping.</p>
<h2>Swapping depths using AS3</h2>
<pre class="brush: as3; title: ; notranslate">function arrangeBoxes():void {
    //For loop will create and place three boxes onto the stage
    for (var i:int = 0; i &lt; 3; i++) {
        var boxColor:ColorTransform = new ColorTransform();
        boxColor.color = (Math.random() * 0xFFFFFF);
        //Define a new box to be added to the stage
        var box:Box = new Box();
        box.x = ((i * 80) + box.width);
        box.y=100;
        box.transform.colorTransform=boxColor;
        box.buttonMode=true;
        box.addEventListener(MouseEvent.MOUSE_OVER, swapMyDepth);
        this.addChild(box);
    }
}

function swapMyDepth(evt:MouseEvent):void {
	this.setChildIndex(Box(evt.target), (this.numChildren - 1));
}

arrangeBoxes();
</pre>
<p>I am just amazed at how much easier and efficient the swapping depth syntax appears in AS3.  In the case of ActionScript 3.0, this solution literally swaps the depth of targeted objects.  There is no &#8220;false advertising&#8221; of swapping depths.</p>
<p>Overall, there is very little left for the designer/developer to manage when dealing with object depth. One less headache to deal with.  Phewww!</p>
<h3><a title="Download source" href="http://flashspeaksactionscript.com/files/swapping-depths-cs3.zip" target="_blank">Download source</a></h3>
<h2>Feedback:</h2>
<p><em>I</em><em> hope this helps in your migration over into  AS3.  If there is something in particular you want to add or see with the Moving From AS2 to AS3 series, feel free to contact me via the <a title="Contact Us" href="../contact/" target="_self">contact page</a>. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://flashspeaksactionscript.com/moving-from-as2-to-as3-handling-depths/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Playing, Stopping, and Pausing Sounds Using AS3</title>
		<link>http://flashspeaksactionscript.com/playing-stopping-and-pausing-sounds-using-as3/</link>
		<comments>http://flashspeaksactionscript.com/playing-stopping-and-pausing-sounds-using-as3/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 23:00:32 +0000</pubDate>
		<dc:creator>Angel Romero</dc:creator>
				<category><![CDATA[AS2 to AS3]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Sound]]></category>

		<guid isPermaLink="false">http://flashspeaksactionscript.com/?p=3306</guid>
		<description><![CDATA[<p>In a previous tutorial, I demonstrated a simple solution to loading an external sound file. In that example, the mp3 file that had been loaded begins to play automatically. While this might be fine in some cases, you probably would want more control over the sound being imported. For example, being able to stop or pause then play again might be a good place to start.     In this tutorial, I will be demonstrating how to <strong>play</strong>, <strong>stop</strong>, and <strong>pause sounds</strong> using AS3 once you have the sound loaded into Flash.</p>
]]></description>
			<content:encoded><![CDATA[<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fflashspeaksactionscript.com%252Fplaying-stopping-and-pausing-sounds-using-as3%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Playing%2C%20Stopping%2C%20and%20Pausing%20Sounds%20Using%20AS3%20%23AS2%20to%20AS3%20%23Beginner%20%23Sound%22%20%7D);"></div>
<p>In a previous tutorial, I demonstrated a <a title="Loading External Sounds Using AS3" href="http://flashspeaksactionscript.com/loading-external-sounds-using-as3/" target="_self">simple solution to loading an external sound file</a>.  In that example, the mp3 file that had been loaded begins to play automatically.  While this might be fine in some cases, you probably would want more control over the sound being imported.</p>
<p>For example, being able to stop or pause then play again might be a good place to start.    In this tutorial, I will be demonstrating how to <strong>play</strong>, <strong>stop</strong>, and <strong>pause sounds</strong> using AS3 once you have the sound loaded into Flash.</p>
<h2>Playing a sound</h2>
<p>Playing a sound using AS3 is a simple as calling the <strong>play()</strong> method of the defined sound object.  Previously in AS2, you would have called the <strong>start()</strong> method so not much different in this area.</p>
<pre class="brush: as3; title: ; notranslate">soundClip.play();</pre>
<h2>Stopping a sound</h2>
<p>Stopping a sound using AS3 is accomplished by calling the <strong>stop()</strong> method of the defined sound object.  This is exactly the same way you would be able to handle it using AS2.</p>
<pre class="brush: as3; title: ; notranslate">soundClip.stop();</pre>
<h2>Pausing a sound</h2>
<p>This is where pausing a sound using AS3 is quite different from using AS2.  As it stands now, there is no method to automatically pause a sound using AS3.  Instead, you must populate an optional parameter of the <strong>play()</strong> method.</p>
<p>It allows you to play the sound using an offset value that is passed in from a stored variable.  Below is an example of accomplishing this.</p>
<pre class="brush: as3; title: ; notranslate">
//Stores the position of the &quot;playback head&quot;
var pausePosition:Number = sndChannel.position;
sndChannel.stop();

//When ready to resume playback, call this line
sndChannel = soundClip.play(pausePosition);</pre>
<h2>Putting it all together</h2>
<p><a title="Playing, Stopping, and Pausing Sounds" rel="shadowbox;height=150;width=300" href="http://www.flashspeaksactionscript.com/files/play-pause-sound/stop-pause-sound-as3.swf"><img class="alignleft size-full wp-image-3310" style="margin-top: 5px; margin-bottom: 5px;" title="Pause/Play Sound" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/03/pause-play-sound.png" alt="Pause/Play Sound" width="200" height="149" /></a>Now it is time to integrate all three.  I have provided an example that puts all three of these control functionalities into good use.  The example is sessentially a simple music player with toggle functionality.</p>
<h3><a title="Preview source" rel="shadowbox;height=150;width=300" href="http://www.flashspeaksactionscript.com/files/play-pause-sound/stop-pause-sound-as3.swf" target="_blank">Preview example</a></h3>
<p><a title="Download source" href="http://www.flashspeaksactionscript.com/files/play-pause-sound/play-pause-source.zip" target="_blank">Download source</a></p>
<p><strong>Subscribe to the <a title="RSS Feed of Flash Speaks ActionScript" href="../feed/" target="_blank">RSS Feed</a> to stay updated on future tutorials on using sound in AS3. </strong></p>
<p><em>I</em><em> hope this helps in your migration over into  AS3.  If there is something in particular you want to add or see with the Moving From AS2 to AS3 series, feel free to contact me via the <a title="Contact Us" href="../contact/" target="_self">contact page</a>. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://flashspeaksactionscript.com/playing-stopping-and-pausing-sounds-using-as3/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Filtering XML Data Using AS3</title>
		<link>http://flashspeaksactionscript.com/filtering-xml-data-using-as3/</link>
		<comments>http://flashspeaksactionscript.com/filtering-xml-data-using-as3/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 20:00:15 +0000</pubDate>
		<dc:creator>Angel Romero</dc:creator>
				<category><![CDATA[AS2 to AS3]]></category>
		<category><![CDATA[Beginner]]></category>

		<guid isPermaLink="false">http://flashspeaksactionscript.com/?p=3291</guid>
		<description><![CDATA[Filtering data XML data using AS2 has to be one of the most sought out features when dealing XML-driven Flash projects. Being able to automatically grab certain relevant information without manually searching each and every XML node and/or attribute.

What if we were given the ability to create filters that will automatically pull the information needed from XML nodes and/or attributes. But wait we can't do that, right? Right, that is until the birth of ActionScript 3.0.]]></description>
			<content:encoded><![CDATA[<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fflashspeaksactionscript.com%252Ffiltering-xml-data-using-as3%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Filtering%20XML%20Data%20Using%20AS3%20%23AS2%20to%20AS3%20%23Beginner%22%20%7D);"></div>
<p>Filtering data XML data using AS2 has to be one of the most sought out features when dealing with XML-driven Flash projects. Being able to automatically grab certain relevant information without manually searching each and every XML node and/or attribute.</p>
<p>What if we were given the ability to create filters that will automatically pull the information needed from XML nodes and/or attributes. But wait we can&#8217;t do that, right? Right, that is until the birth of ActionScript 3.0.</p>
<p>Another new feature in AS3 is the ability to<strong> filter and display</strong> only the data you are interested in. With this, you can dynamically filter XML nodes and attributes.</p>
<h3>Filtering XML Node Values</h3>
<p>Let&#8217;s say you wanted to pull all the of the books that were paperback. You can now create a function that scans each XML&#8217;s node or attribute value and returns which node would qualify with the given query. See the example below in which outputs the books in which are paperback.</p>
<p><em>Note: I am using this <a title="book-list.xml" href="http://www.flashspeaksactionscript.com/files/filtering-xml-as3/book-list.xml" target="_blank">XML file</a> in the example.</em></p>
<pre class="brush: as3; title: ; notranslate">
var xmlLoader:URLLoader=new URLLoader  ;
var xmlData:XML=new XML  ;
//Adding an event listener to notify when loading is completed
xmlLoader.addEventListener(Event.COMPLETE,LoadXML);
//Load the XML file
xmlLoader.load(new URLRequest(&quot;book-list.xml&quot;));

function LoadXML(e:Event):void {
	xmlData=new XML(e.target.data);
	ParseBooks(xmlData);
}

function ParseBooks(bookInput:XML):void {
	//Creating an xml list that will store the book info
	var books:XMLList=bookInput.book.children();
	//Creating a xml list that will store the book's ISBN number
	var bookAttributes:XMLList=bookInput.book.attributes();
	//Filter out all of the books with a &quot;Paperback&quot; cover
	var paperBackList:XMLList=bookInput.book.coverType==&quot;Paperback&quot;;
	trace(paperBackList);
}</pre>
<h2>Filtering XML Attributes</h2>
<p>Not only can you filter XML node values but you can do the same to XML Attributes values. In the a previous post , <a title="Loading XML Data Using AS3" href="http://flashspeaksactionscript.com/loading-xml-data-using-as3/" target="_blank">Loading XML Data</a>, I created and included an attribute labeled &#8220;ISBN&#8221; which would be available within each book node. If you wanted to return a list of books that matched a certain value, it would go something like this.</p>
<p><em>Note: I am simply replacing the ParseBooks function from the code above</em></p>
<pre class="brush: as3; title: ; notranslate">
function ParseBooks(bookInput:XML):void {
	//Creating an xml list that will store the book info
	var books:XMLList=bookInput.book.children();
	//Creating a xml list that will store the book's ISBN number
	var bookAttributes:XMLList=bookInput.book.attributes();
	//Filter out the book with a matching ISBN number
	var closeMatchList:XMLList=bookInput.book.@isbn==&quot;978-0596526948&quot;;
	trace(closeMatchList);
}</pre>
<p>As you can see, there isn&#8217;t much of a difference with filtering by XML node values or attribute information. Filtering can provide such a dynamic form of functionality to any Flash project: big or small.</p>
<h3><a title="Download Source" href="http://www.flashspeaksactionscript.com/files/filtering-xml-as3/download-source.zip" target="_blank">Download Source</a></h3>
<p><strong>I&#8217;d love to hear from you.  What do you think of this new functionality when dealing with XML data?</strong></p>
<h2>Feedback:</h2>
<p><em>I</em><em> hope this helps in your migration over into  AS3.  If there is something in particular you want to add or see with the Moving From AS2 to AS3 series, feel free to contact me via the <a title="Contact Us" href="../contact/" target="_self">contact page</a>. </em></p>
<p><em><strong>Subscribe to the <a title="RSS Feed of Flash Speaks ActionScript" href="http://feeds.feedburner.com/flashspeaksactionscript/tmgY" target="_blank">RSS Feed</a> to stay updated on future tutorials on using XML in AS3. </strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://flashspeaksactionscript.com/filtering-xml-data-using-as3/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Loading External Sounds Using AS3</title>
		<link>http://flashspeaksactionscript.com/loading-external-sounds-using-as3/</link>
		<comments>http://flashspeaksactionscript.com/loading-external-sounds-using-as3/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 01:00:45 +0000</pubDate>
		<dc:creator>Angel Romero</dc:creator>
				<category><![CDATA[AS2 to AS3]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Sound]]></category>

		<guid isPermaLink="false">http://flashspeaksactionscript.com/?p=3258</guid>
		<description><![CDATA[Sound has become a key addition to many Flash projects: offline and online. In many cases, integrating sound can actually amplify the final results of a project. However, in many other cases sound should not even be a topic for discussion. Whatever your case may be, I am going to quickly go over how to load an external sound file using AS3.]]></description>
			<content:encoded><![CDATA[<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fflashspeaksactionscript.com%252Floading-external-sounds-using-as3%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Loading%20External%20Sounds%20Using%20AS3%20%23AS2%20to%20AS3%20%23Beginner%20%23Sound%22%20%7D);"></div>
<p>Sound has become a key addition to many Flash projects: offline and online. In many cases, integrating sound can actually amplify the final results of a project. However, in many other cases sound should not even be a topic for discussion.</p>
<p>Loading external sound into your Flash projects using AS2 is a fairly easy task.  Using AS3 to load external sounds is just as simple.  I am going to quickly go over how to load an external sound file using AS3 in comparison to AS2 syntax.</p>
<h2>Loading external sound using AS2</h2>
<pre class="brush: as3; title: ; notranslate">
//Create a new sound object
var song:Sound=new Sound();
//Load the external sound file
song.loadSound(&quot;song.mp3&quot;,true);
//Once loaded play the sopund file
song.onSoundComplete=function() {
	song.start();
}</pre>
<h2>Loading external sound using AS3</h2>
<pre class="brush: as3; title: ; notranslate">
//Create an instance of the Sound class
var soundClip:Sound=new Sound();
//Create a new SoundChannel Object
var sndChannel:SoundChannel=new SoundChannel();
//Load sound using URLRequest
soundClip.load(new URLRequest(&quot;song.mp3&quot;));
//Create an event listener that wll update once sound has finished loading
soundClip.addEventListener(Event.COMPLETE,onComplete,false,0,true);
function onComplete(evt:Event):void {
	//Play loaded sound
	sndChannel=soundClip.play();
}</pre>
<h2>What is the difference?</h2>
<h3>Event model consistency</h3>
<p>Loading external sound and playing it using AS3 is quite similar to that of AS2 syntax. The key difference between the two would have to the new event model integration that AS3 brings to the table.</p>
<h3>Introducing Sound Channel</h3>
<p>One other difference is the declaration and use of a Sound Channel. The SoundChannel class is used to create a separate channel for each new sound played. By placing each sound in its own channel, you can work with multiple sounds but control each sound separately.</p>
<h3>Conclusion</h3>
<p>Overall, the changes between AS2 to AS3 in loading external sound are not far off from each other. However, AS3 does introduce a boat load of new features and classes that allow for creative uses of sound in your Flash Projects. Some of the other new features include: visualizing sound data, reading ID3 Metadata, and transformation of the sound files.</p>
<h3><a title="Download Source" href="http://flashspeaksactionscript.com/files/loading-sound-as3/loading-sound-cs3.zip" target="_blank">Download Source</a></h3>
<p><strong>Subscribe to the <a title="RSS Feed of Flash Speaks ActionScript" href="http://flashspeaksactionscript.com/feed/" target="_blank">RSS Feed</a> to stay updated on future tutorials on using sound in AS3. </strong></p>
<p><em>I</em><em> hope this helps in your migration over into  AS3.  If there is something in particular you want to add or see with the Moving From AS2 to AS3 series, feel free to contact me via the <a title="Contact Us" href="../contact/" target="_self">contact page</a>. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://flashspeaksactionscript.com/loading-external-sounds-using-as3/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Loading XML Data Using AS3</title>
		<link>http://flashspeaksactionscript.com/loading-xml-data-using-as3/</link>
		<comments>http://flashspeaksactionscript.com/loading-xml-data-using-as3/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 21:00:59 +0000</pubDate>
		<dc:creator>Angel Romero</dc:creator>
				<category><![CDATA[AS2 to AS3]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://flashspeaksactionscript.com/?p=3245</guid>
		<description><![CDATA[Thanks to the Adobe Gods for making the lives of so many Flash developers much less complicated when dealing with XML Data. XML and AS2 just did not get along very well.

In AS3, the XML libraries have been completely overhauled. These new changes provide a much more seamless XML integration that is based on the web standards of E4X.]]></description>
			<content:encoded><![CDATA[<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fflashspeaksactionscript.com%252Floading-xml-data-using-as3%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Loading%20XML%20Data%20Using%20AS3%20%23AS2%20to%20AS3%20%23Beginner%20%23XML%22%20%7D);"></div>
<p>Thanks to the Adobe Gods for making the lives of so many Flash developers much less complicated when dealing with XML Data. XML and AS2 just did not get along very well. It was one of those situations where there was a love/hate relationship.</p>
<p>Love was there when you&#8217;ve hacked yourself an impressive solution that simple works well, but that hate returns when it was time to change the XML structure. Going back and rerouting the paths to the correct XML nodes was just painful.</p>
<p>It&#8217;s funny because I did not foresee a brighter day for dealing with Flash and XML data. Those brighter days have now finally come with the newly added XML classes that will basically do all the work for you.</p>
<p>The XML libraries have been completely overhauled in AS3. These new changes provide a much more seamless XML integration that is based on the web standards of E4X.</p>
<h2>What is E4X?</h2>
<p>E4X (ECMA for XML) is the current World Wide Web Consortium standard for reading and writing XML documents, and greatly reduces the amount of code and hoop-jumping required to communicate with XML. It allows you to treat XML objects like any other object with familiar dot syntax, and provides additional shortcuts for traversing XML trees.</p>
<p>By providing the support for E4X, the amount of code and maneuvering in and out of XML nodes is greatly reduced and easier to understand.</p>
<p>In the examples below, I will first demonstrate the AS2 integration of loading XML data followed by the AS3 comparison.</p>
<h2>Loading XML data using AS2</h2>
<p>&nbsp;</p>
<pre class="brush: as3; title: ; notranslate">
//Load XML Data
function loadXML(loaded) {
	if (loaded) {
		var xmlNode=this.firstChild;
		var total:Number=xmlNode.childNodes.length;
		//Creating the arrays needed for storing off the XML data
		var bookInfo:Array=new Array(total);
		var isbnNum:Array=new Array(total);
		var subNum:Array=new Array(total);
		for (var i:Number=0; i&amp;lt;total; i++) {
			//Storing off the ISBN values into an array
			isbnNum[i]=xmlNode.childNodes[i].attributes.isbn;
			//Storing off each parent's(book) children count
			subNum[i]=xmlNode.childNodes[i].childNodes.length;
			bookInfo[i]=new Array(subNum[i]);
			trace(&amp;quot;ISBN = &amp;quot;+isbnNum[i]);
			trace(&amp;quot;Book Info:&amp;quot;);
			for (var j:Number=0; j&amp;lt;subNum[i]; j++) {
				//Store the book info of all the books into a 2D Array
				//Thie is the path to the desired xml nodes
				bookInfo[i][j]=xmlNode.childNodes[i].childNodes[j].firstChild.nodeValue;
				trace(bookInfo[i][j]);
			}
		}
	} else {
		trace(&amp;quot;Error loading XML&amp;quot;);
	}
}
//Required syntax
xmlData=new XML  ;
xmlData.ignoreWhite=true;
xmlData.onLoad=loadXML;
xmlData.load(&amp;quot;book-list.xml&amp;quot;);
stop();
</pre>
<p>&nbsp;</p>
<h2>Loading XML data using AS3</h2>
<p>&nbsp;</p>
<pre class="brush: as3; title: ; notranslate">
var xmlLoader:URLLoader=new URLLoader  ;
var xmlData:XML=new XML  ;
//Adding an event listener to notify when loading is completed
xmlLoader.addEventListener(Event.COMPLETE,LoadXML);
//Load the XML file
xmlLoader.load(new URLRequest(&amp;quot;book-list.xml&amp;quot;));

function LoadXML(e:Event):void {
	xmlData=new XML(e.target.data);
	ParseBooks(xmlData);
}

function ParseBooks(bookInput:XML):void {
	//Creating an xml list that will store the book info
	var books:XMLList=bookInput.book.children();
	//Creating a xml list that will store the book's ISBN number
	var bookAttributes:XMLList=bookInput.book.attributes();
	//Extract the data from the populated XML lists
	for (var j:int=0; j&amp;lt;bookAttributes.length(); j++) {
		var bookISBNNum:XML=bookAttributes[i];
		trace(&amp;quot;ISBN = &amp;quot;+bookISBNNum);
	}
	for (var i:int=0; i&amp;lt;books.length(); i++) {
		var bookInfo:XML=books[i];
		trace(bookInfo);
	}
}
</pre>
<p>&nbsp;</p>
<h2>What&#8217;s the difference?</h2>
<h3>The Use of XML Lists</h3>
<p>A XML List is a list use to store specific XML nodes or attributes. The way I see it XML Lists are basically arrays formatted for dealing with XML data. This eliminates the need of creating all multiple arrays to store your data for further use &#8211; the XML List will do it all for you. If we wanted to, we can save off the an individual list for the author and book title by simply creating an XML List and filtering the specific node data. See code below.</p>
<h3>Returning any or all of the XML data</h3>
<p>Filtering and storing off any or all XML data becomes a more natural process.<br />
<!-- google_ad_section_start(weight=ignore) --></p>
<pre class="brush: as3; title: ; notranslate">
//This xml list stores all of each book's data
var bookChildren:XMLList = bookInput.Book.children();
//This xml list will only store the author's info
var authorList:XMLList=bookInput.book.author;
//This xml list will only store the title's info
var titleList:XMLList=bookInput.book.title;
</pre>
<p>&nbsp;</p>
<h3>No need to define ignoreWhite to true</h3>
<p>WithinAS3 there is not a need to define the ignoreWhite state to true. By default this is automatically set to true. Makes sense right!</p>
<p>Overall, you can see that loading XML data into Flash is as seamless as can be. No more headaches on trying to get your XML file to work for you. There&#8217;s more to the new XML classes than what you see on this page and I plan to touch on more of it in the next few days. If you are in need of additional resources, check out the ones below.</p>
<h2>Additional Resources:</h2>
<ul>
<li><a title="Using XML in Flash CS3/AS3" href="http://www.kirupa.com/developer/flashcs3/using_xml_as3_pg1.htm" target="_blank">Using XML in Flash CS3/AS3</a></li>
<li><a title="AS3 E4X Rundown" href="http://dispatchevent.org/roger/as3-e4x-rundown/" target="_blank">AS3 E4X Rundown</a></li>
<li><a title="ActionScript 3 XML Basics" href="http://www.gotoandlearn.com/play.php?id=64" target="_blank">ActionScript 3 XML Basics</a></li>
</ul>
<h3><a title="Download Source Files" href="http://flashspeaksactionscript.com/files/loading-xml-as3/loading-xml-as3.zip" target="_blank">Download Source</a></h3>
<p><em>I</em><em> hope this helps in your migration over into  AS3.  If there is something in particular you want to add or see with the Moving From AS2 to AS3 series, feel free to contact me via the <a title="Contact Us" href="../contact/" target="_self">contact page</a>. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://flashspeaksactionscript.com/loading-xml-data-using-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preloading Content Using AS3</title>
		<link>http://flashspeaksactionscript.com/preloading-content-using-as3/</link>
		<comments>http://flashspeaksactionscript.com/preloading-content-using-as3/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 20:00:03 +0000</pubDate>
		<dc:creator>Angel Romero</dc:creator>
				<category><![CDATA[AS2 to AS3]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Preloading]]></category>

		<guid isPermaLink="false">http://flashspeaksactionscript.com/?p=3236</guid>
		<description><![CDATA[While most smaller Flash projects do not really need a preloader due to the today's Internet speed, it is still good practice to always include a preloader in all your Flash projects.  In this brief tutorial, I will demonstrate how to preload your Flash assets using AS3.]]></description>
			<content:encoded><![CDATA[<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fflashspeaksactionscript.com%252Fpreloading-content-using-as3%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Preloading%20Content%20Using%20AS3%20%23AS2%20to%20AS3%20%23Beginner%20%23Preloading%22%20%7D);"></div>
<p>While most smaller Flash projects do not really need a preloader due to the today&#8217;s Internet speed, it is still good practice to always include a preloader in all your Flash projects.  In this brief tutorial, I will demonstrate how to preload your Flash assets using AS3.</p>
<p>Preloading in AS3 is a more streamlined process due to the new &amp; improved event handling structure that AS3 brings to the table.  You have more control over what gets preloaded and when it gets preloaded.</p>
<h2>How to Preload with AS3</h2>
<p>Like most things in Flash, there are many ways to preload your content into your Flash projects.  How you create your preloading animation will be totally up to you.  In this example, I will be dynamically resizing a preloader&#8217;s fill based on the progress percentage of the content being loaded. It is a simple way to demonstrate a preloading action.</p>
<h2>Preview the example</h2>
<p><a title="Preview the example" rel="shadowbox;height=535;width=800" href="http://flashspeaksactionscript.com/files/preloading-as3/preloader.swf"><img class="alignnone size-full wp-image-3235" title="Preloading Content AS3" src="http://flashspeaksactionscript.com/wp-content/uploads/2009/02/preloading-content-as3.png" alt="Preloading Content AS3" width="500" height="150" /></a></p>
<h2>Code used in example</h2>
<pre class="brush: as3; title: ; notranslate">
//Define a loader
var imageLoader:Loader;

function loadThisImage(url:String):void {
	//Show Preloader
	preloader.visible=true;
	imageLoader=new Loader();
	imageLoader.load(new URLRequest(url));
	//Add a listener to update the preloader on the image's progress
	imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,imageLoading);
	//Adding a listener that will update the preloader once the image has been loaded
	imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,imageLoaded);
}

function imageLoaded(evt:Event):void {
	// Load Image by adding it to the display list
	imageLoaderClip.addChild(imageLoader);
	// Hide Preloader
	preloader.visible=false;
}

function imageLoading(evt:ProgressEvent):void {
	// Get the current download progress
	var loaded:Number=evt.bytesLoaded/evt.bytesTotal;
	// Send progress info to &quot;preloader&quot; movie clip
	updateProgress(loaded);
}

function updateProgress(value:Number) {
	preloader.progress.width=value*preloader.bar.width;
}

//Loading the image defined in the parameter
loadThisImage(&quot;image-loaded-large.jpg&quot;);
</pre>
<p><!-- google_ad_section_end --><br />
As you noticed this example loads an image, but you can very well use it to load you main SWF content or even multiple images.  By creating multiple loaders, you can then define the asset in which you choose to load.  This will allow you more control over your content being loaded.</p>
<p>As you can see,  preloading content using AS3 is actually pretty easy.  Have fun migrating over into AS3!</p>
<h2><a title="Download source" href="http://flashspeaksactionscript.com/files/preloading-as3/preloading.zip" target="_blank">Download Source</a></h2>
<p><em>I</em><em> hope this helps in your migration over into  AS3.  If there is something in particular you want to add or see with the Moving From AS2 to AS3 series, feel free to contact me via the <a title="Contact Us" href="../contact/" target="_self">contact page</a>. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://flashspeaksactionscript.com/preloading-content-using-as3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 1378/1492 objects using disk: basic

Served from: flashspeaksactionscript.com @ 2012-02-07 22:14:40 -->
