<?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>Alex Brooke &#187; learn flash</title>
	<atom:link href="http://alexbrooke.com/alex%20brooke/learn-flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexbrooke.com</link>
	<description>Music and tech in Tokyo</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:38:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Flash AS3 Preloader Tutorial</title>
		<link>http://alexbrooke.com/as3-preloader-tutorial/</link>
		<comments>http://alexbrooke.com/as3-preloader-tutorial/#comments</comments>
		<pubDate>Sun, 22 May 2011 15:01:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Learn Flash]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[as3 preloader tutorial]]></category>
		<category><![CDATA[CS4]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[learn flash]]></category>
		<category><![CDATA[preloader tutorial]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://alexbrooke.com/?p=750</guid>
		<description><![CDATA[This is a tutorial on how to make a very simple AS3 (CS4) preloader for your Flash movies. This tutorial assumes you are a beginner at Flash. 1) Create a new flash document and a draw rectangle on the stage. This will be our preloader bar. 2) Select it, then click Modify in the top [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-4508730612729392";
google_ad_slot = "2519985644";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<br />
This is a tutorial on how to make a very simple AS3 (CS4) preloader for your Flash movies. This tutorial assumes you are a beginner at Flash.</p>
<p style="text-align: center;"><a href="http://alexbrooke.com/wp-content/uploads/preloader.png"><img class="aligncenter size-full wp-image-767" style="border: 1px solid black;" title=" preloader" src="http://alexbrooke.com/wp-content/uploads/preloader.png" alt=" preloader" width="470" height="216" /></a></p>
<p>1) Create a new flash document and  a draw rectangle on the stage. This will be our preloader bar.</p>
<p>2) Select it, then click <em><strong>Modify</strong></em> in the top menu and then <em><strong>Convert to symbol</strong></em></p>
<p>3) Give it any name you like and make sure that the <strong><em>Type</em></strong> is selected to <em><strong>Movie Clip</strong></em>. Also make sure you select the middle left box on the registration point as we want it to expand from left to right. Click OK to save.</p>
<p style="text-align: center;"><em><a href="http://alexbrooke.com/wp-content/uploads/symbolconvert.jpg"><img class="aligncenter size-medium wp-image-760" title=" symbolconvert" src="http://alexbrooke.com/wp-content/uploads/symbolconvert-300x87.jpg" alt=" symbolconvert" width="300" height="87" /></a>click to enlarge</em></p>
<p>4) Underneath the preloader bar you just drew, insert a dynamic text field.</p>
<p>5) Give the preloader bar an instance name of &#8220;loaderBar&#8221; and give the text field an instance name of &#8220;loaderText&#8221;</p>
<p><a href="http://alexbrooke.com/wp-content/uploads/loaderbarinstancename.jpg"><img class="aligncenter size-full wp-image-763" title=" loaderbarinstancename" src="http://alexbrooke.com/wp-content/uploads/loaderbarinstancename.jpg" alt=" loaderbarinstancename" width="285" height="85" /></a></p>
<p><a href="http://alexbrooke.com/wp-content/uploads/textinsatncename.jpg"><img class="aligncenter size-full wp-image-764" title=" textinsatncename" src="http://alexbrooke.com/wp-content/uploads/textinsatncename.jpg" alt=" textinsatncename" width="285" height="83" /></a></p>
<p>6) Make a new layer above the current one and label it &#8220;actionscript&#8221;. You can also give the bottom layer a name such as &#8220;bar&#8221; if you want.</p>
<p><a href="http://alexbrooke.com/wp-content/uploads/actionscriptlayer.jpg"><img class="aligncenter size-full wp-image-765" title=" actionscriptlayer" src="http://alexbrooke.com/wp-content/uploads/actionscriptlayer.jpg" alt=" actionscriptlayer" width="214" height="79" /></a></p>
<p>Click on the first frame of the actionscript layer and open the actions window. (Click Window and then Actions in the top menu)</p>
<p>7) Insert the following code:</p>
<blockquote><p>stop();<br />
import flash.display.*;<br />
this.stop();<br />
this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, PRELOADER);<br />
function PRELOADER(event:ProgressEvent):void {<br />
var percent:Number=event.bytesLoaded/event.bytesTotal*100;<br />
loaderBar.scaleX=pcent/100;<br />
loaderText.text=int(percent)+&#8221;%&#8221;;<br />
if(percent==100){<br />
this.gotoAndStop(2);<br />
}<br />
}</p></blockquote>
<p> <img src='http://alexbrooke.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Make a new blank frame at frame two of the layer with the preloader bar you drew and import a picture so we have something to load.</p>
<p>9) Click <em><strong>Control</strong></em> and then <strong><em>Test Movie</em></strong> and&#8230; it won&#8217;t work properly. As you are loading this file from your computer, it will load instantaneously. We need to slow down the load rate for us to check it works.</p>
<p>10) Click on <em><strong>View</strong></em> in the top menu and then <em><strong>Simulate download</strong></em>. You should now see your preloader bar slowly expand with the progress in a percentage underneath. If you are still having problems you can adjust the download simulation rate in <em><strong>View</strong></em> and then <em><strong>Download settings</strong></em></p>
<p style="text-align: center;"><a href="http://media.libsyn.com/media/japanese/preloadertutorial.fla"><em><strong><img class="aligncenter size-full wp-image-769" title=" flashicon" src="http://alexbrooke.com/wp-content/uploads/flashicon.png" alt=" flashicon" width="65" height="57" /></strong>Download the example file here</em></a></p>
<p style="text-align: left;"><em><strong>NOTES</strong></em></p>
<p style="text-align: left;"><em>If you have an animation that plays from frame 2 onwards you can change the line &#8220;</em><em>this.gotoAndStop(2);&#8221; to &#8220;</em><em>this.gotoAndPlay(2);&#8221;</em></p>
<p style="text-align: left;"><em>Please leave your questions, comments and responses to this article. Please let me know of any mistakes, inaccuracies or problems with this tutorial and I&#8217;ll try to fix it. Enjoy!</em></p>
<p style="text-align: left;">
<p style="text-align: left;"><em><br />
</em></p>
<p style="text-align: left;">
<p style="text-align: left;">
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/share?url=http://alexbrooke.com/as3-preloader-tutorial/&text=Flash+AS3+Preloader+Tutorial&via=tweetthisplugin&related=richardxthripp%2Ctweetthisplugin" title="Post to Twitter"><img class="nothumb" src="http://alexbrooke.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://alexbrooke.com/as3-preloader-tutorial/&amp;t=Flash+AS3+Preloader+Tutorial" title="Post to Facebook"><img class="nothumb" src="http://alexbrooke.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://stumbleupon.com/submit?url=http://alexbrooke.com/as3-preloader-tutorial/&amp;title=Flash+AS3+Preloader+Tutorial" title="Post to StumbleUpon"><img class="nothumb" src="http://alexbrooke.com/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://alexbrooke.com/as3-preloader-tutorial/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

