<?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>Web Style Press, Best Practices from all the Web, Build Better Websites &#187; Preloaders</title>
	<atom:link href="http://www.webstylepress.com/category/adobe-flash/loaders/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webstylepress.com</link>
	<description>Web VS Style</description>
	<lastBuildDate>Mon, 26 Dec 2011 10:35:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Flash ActionScript Preloaders &#8211; Tutorials and Downloads</title>
		<link>http://www.webstylepress.com/flash-loader/</link>
		<comments>http://www.webstylepress.com/flash-loader/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 13:57:54 +0000</pubDate>
		<dc:creator>Hiroshi</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Preloaders]]></category>
		<category><![CDATA[flash loader]]></category>
		<category><![CDATA[load movies]]></category>
		<category><![CDATA[loading]]></category>

		<guid isPermaLink="false">http://www.webstylepress.com/?p=115</guid>
		<description><![CDATA[Learn about flash preloaders. How to create different kind of preloaders for flash movie using advanced ActionScript. Follow these tutorials to learn how to set up preloader in flash using ActionScript and download ready to use examples of flash ActionScript preloaders. What is Flash Preloader A preloader preloads the whole flash movie or some part [...]<p><a href="http://www.webstylepress.com/flash-loader/">Flash ActionScript Preloaders &#8211; Tutorials and Downloads</a> is a post from: <a href="http://www.webstylepress.com">Web Style Press, Best Practices from all the Web, Build Better Websites</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Learn about flash preloaders. How to create different kind of preloaders for flash movie using advanced ActionScript. Follow these tutorials to learn how to set up preloader in flash using ActionScript and download ready to use examples of flash ActionScript preloaders.</p>
<p><span id="more-115"></span></p>
<h4>What is Flash Preloader</h4>
<p>A preloader preloads the whole flash movie or some part of it before playing it. This saves user to see animation in segments and informs him about movie progress so that he may know that how much movie is being loaded and how much is remaining. In absence of preloader any flash movie will be jerky and will not be considered as a good animation. Animation can be referred to a consistent motion. If animation stops again and again after some seconds or so then usually user will get bored and close it very soon. Flash movie loads first and then plays. So its a good idea to build a preloader which will count some parameters and informs user about movie loading progress and when it is 100% it will be played. There are many ways and uses of preloaders depending upon requirement. I will explain here: how to create different kind of flash preloaders and applying these into movies.</p>
<p>Following examples will explain to create all kind of preloaders, from simple to advanced with look and feel customization.</p>
<h4>Creating a Custom Preloader In Flash</h4>
<h5>Simple and Basic Preloader</h5>
<p>You might like to use basic loaders in which there is no progress display but these load full movies and then play them.</p>
<p>We take first two frames.<br />
We will check; Are loaded frames equal to total frames in the movie.<br />
If yes then movie will jump from frame 1 to 3.<br />
If frames loaded are not equal to total frames then movie will go to frame no. 2.<br />
At frame no.2, we place action of go back to frame no.1.<br />
By this way when the whole movie will be loaded, preloader will allow the movie to proceed.</p>
<h5>Simple preloader method 1</h5>
<h6>:: Script at Frame 1 ::</h6>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">ifFrameLoaded</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Scene 1&quot;</span>, <span style="color: #cc66cc;">160</span><span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">gotoAndPlay</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h6>:: Script at Frame 2 ::</h6>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">gotoAndPlay</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<h5>Simple preloader method 2</h5>
<h6>:: Script at Frame 1 ::</h6>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">_framesloaded</span> <span style="color: #66cc66;">&gt;</span>= <span style="color: #0066CC;">_totalframes</span><span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">gotoAndPlay</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<h6>:: Script at Frame 2 ::</h6>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">gotoAndPlay</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><span class="downloadfile"><a href='http://www.webstylepress.com/wp-content/uploads/2008/10/basic-loader.rar'>basic-loader</a></span></p>
<h5>Simple Percentage Preloader</h5>
<h6>Look and Feel</h6>
<p><strong>40%</strong></p>
<p>This preloader just shows up the percentage loaded for flash movie.</p>
<h6>Instructions</h6>
<p>Add stop action at first frame.<br />
Create a movie clip.<br />
Double click at movie clip to go in.<br />
In that take a dynamic text and assign it a name such as <strong>percentage</strong><br />
Come back outside of movie clip at main timeline.<br />
Single click at movie clip and type the following actionscript in actions panel.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span>enterFrame<span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
percentage = <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">/</span><span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesTotal</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesLoaded</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>+<span style="color: #ff0000;">&quot;%&quot;</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>percentage == <span style="color: #cc66cc;">100</span>+<span style="color: #ff0000;">&quot;%&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">Play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>This will show up a text percentage loader before movie starts and at 100% it will play the movie.</p>
<p><span class="downloadfile"><a href='http://www.webstylepress.com/wp-content/uploads/2008/10/percentage.rar' target="_blank">Download Percentage preloader Example</a></span></p>
<h5>Bar Preloader</h5>
<h6>Look and Feel</h6>
<p><img src="http://www.webstylepress.com/wp-content/uploads/2008/10/bar1.jpg" alt="" title="bar1" width="100" height="20" class="alignnone size-full wp-image-117" /></p>
<h6>Instructions</h6>
<p>Create a movie clip and give it a name i.e. preloader.<br />
In that movie clip create a bar and in other layer its outline.<br />
After creating bar movie clip and type actionscript at it.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_xscale</span> = <span style="color: #ff0000;">&quot;0&quot;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Remember to name that movie clip as <strong>bar</strong> because thats going to use in actionscript. Alright and define that bar&#8217;s center to left if you want to start filling that bar with color from left and right or center for different requirements.</p>
<p>Finally come back at main time line and at main movie clip type the following actionscript.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span>enterFrame<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
percentage = <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">/</span><span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesTotal</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesLoaded</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>+<span style="color: #ff0000;">&quot;%&quot;</span>;
<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">preloader</span>.<span style="color: #006600;">bar</span>.<span style="color: #0066CC;">_xscale</span> = siteLoaded;
siteLoaded = <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>loaded_bytes<span style="color: #66cc66;">/</span>total_bytes<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
total_bytes = <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesTotal</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
loaded_bytes = <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesLoaded</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>percentage == <span style="color: #cc66cc;">100</span>+<span style="color: #ff0000;">&quot;%&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">Play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><span class="downloadfile"><a href='http://www.webstylepress.com/wp-content/uploads/2008/10/bar.rar'>Download Bar Preloader</a></span></p>
<hr />
<h5>Percentage and Bar Preloader</h5>
<h6>Look and Feel</h6>
<p><img src="http://www.webstylepress.com/wp-content/uploads/2008/10/barandpercentageloader.gif" alt="" title="barandpercentageloader" width="147" height="16" class="alignnone size-full wp-image-119" /></p>
<h6>Instructions</h6>
<p>Same Procedure as in above <strong>bar preloader example</strong><br />
Just add a dynamic text and assign it name as <strong>percentage</strong> in preloader movie clip with bar. All other script is same for bar and main movie clip.</p>
<p><span class="downloadfile"><a href='http://www.webstylepress.com/wp-content/uploads/2008/10/percentage-and-bar-loader.rar'>Percentage and Bar Loader Download</a></span></p>
<h5>Percentage, Bar, Nice Preloader</h5>
<h6>Look and Feel</h6>
<p><img src="http://www.webstylepress.com/wp-content/uploads/2008/10/loader2.jpg" alt="" title="loader2" width="101" height="41" class="alignnone size-full wp-image-121" /></p>
<h6>Instructions</h6>
<p>Add stop action at first frame to stop movie in the beginning.<br />
In new layer create a movie clip at first frame and create interface.<br />
Take dynamic text named as <strong>text</strong> inside that movie clip.<br />
Inside movie clip add 100 frames in new layer.<br />
Create a bar and give it shape tweening or motion of 100 frames.<br />
Come back at main timeline (outside of movie clip) and type this actionscript at main movie.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
total = <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesTotal</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span>enterFrame<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">loaded</span> = <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesLoaded</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
percent = <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">loaded</span><span style="color: #66cc66;">/</span>total<span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">text</span> = percent+<span style="color: #ff0000;">&quot;%&quot;</span>;
<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span>percent<span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">loaded</span> == total<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">gotoAndPlay</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><span class="downloadfile"><a href='http://www.webstylepress.com/wp-content/uploads/2008/10/bar-and-percentage-nice-loader.rar'>Bar and Percentage Nice Flash Preloader Download</a></span></p>
<h5>Flash KB Preloader &#8211; Total KB, Downloaded KB, Percentage, Loading Bar</h5>
<h6>Look and Feel</h6>
<p><img src="http://www.webstylepress.com/wp-content/uploads/2008/10/kb.jpg" alt="" title="kb-loader" width="150" height="60" class="alignnone size-full wp-image-129" /></p>
<h6>Instructions</h6>
<p>Take movie clip named as <strong>preloader</strong>.<br />
Inside it, take other dynamic text fields and assign them variables names as <strong>loadedkb</strong>, <strong>totalkb</strong>, <strong>percentage</strong>.<br />
These variables are being used in the following script</p>
<p>At bar movieclip same script as in bar loader example and at main movie type following action script.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span>enterFrame<span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
percentage = <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">/</span><span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesTotal</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesLoaded</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>+<span style="color: #ff0000;">&quot;%&quot;</span>;
<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">preloader</span>.<span style="color: #006600;">bar</span>.<span style="color: #0066CC;">_xscale</span> = siteLoaded;
siteLoaded = <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>loaded_bytes<span style="color: #66cc66;">/</span>total_bytes<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
loadedkb = <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>loaded_bytes<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">1024</span><span style="color: #66cc66;">&#41;</span> <span style="color: #0066CC;">add</span> <span style="color: #ff0000;">&quot;KB&quot;</span>;
totalkb = <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>total_bytes<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">1024</span><span style="color: #66cc66;">&#41;</span> <span style="color: #0066CC;">add</span> <span style="color: #ff0000;">&quot;KB&quot;</span>;
total_bytes = <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesTotal</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
loaded_bytes = <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesLoaded</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>percentage == <span style="color: #cc66cc;">100</span>+<span style="color: #ff0000;">&quot;%&quot;</span><span style="color: #66cc66;">&#41;</span> 
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">Play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>If you want to just use KB preloader than remove other dynamic text fields and bar and also in main script remove script relating to bar and kb and use it.</p>
<p><span class="downloadfile"><a href='http://www.webstylepress.com/wp-content/uploads/2008/10/kb.rar'>Download This Preloader</a></span></p>
<h5>All In One Preloader 1</h5>
<h6>Look and Feel</h6>
<p><img src="http://www.webstylepress.com/wp-content/uploads/2008/10/all-in-one-1.jpg" alt="" title="All in One Preloader Example 1 Download" width="205" height="118" class="alignnone size-full wp-image-133" /></p>
<p><span class="downloadfile"><a href='http://www.webstylepress.com/wp-content/uploads/2008/10/all-in-one-preloader-full-1.rar'>All in One Preloader Example 1 Download</a></span></p>
<h5>All In One Preloader 2</h5>
<h6>Look and Feel</h6>
<p><img src="http://www.webstylepress.com/wp-content/uploads/2008/10/all-in-one-2.jpg" alt="" title="all-in-one-preloader" width="427" height="269" class="alignnone size-full wp-image-135" /></p>
<p><span class="downloadfile"><a href='http://www.webstylepress.com/wp-content/uploads/2008/10/all-in-one-preloader-2.rar'>All in One Preloader Example 2 Download</a></span></p>
<h5>Preload External swf Movies &#8211; Advanced Preloading</h5>
<p>Now here scenario is little bit different. I take two swf movies. One is container in which first movie is located and than other comes from outside and both have same loader files with slight difference and next all other movies which come from outside contain same loader as first one. The point is you place loader withing container and program it to preload and then when you call other swf movie that is outside and is coming on click event of a button. You definitely take some target or level to load that movie. You will place action on button and tell the next movie to come but while loading you will further tell the movie to load in target or level and the loaders will work fine and you are done. When 100% will be completed the movie will play that target and not the container root. I think u got that.</p>
<p>When I first tried this; At external movie loading completion where it tells to play the external movie, it was playing the container movie from the start, because both have same loaders. Then I got the idea of loading the target movie and playing the target movie on 100% loading completion.</p>
<p><strong>Container Main Movie Loader Actionscript</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
total = <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesTotal</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span>enterFrame<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">loaded</span> = <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getBytesLoaded</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
percent = <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">loaded</span><span style="color: #66cc66;">/</span>total<span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">text</span> = percent+<span style="color: #ff0000;">&quot;%&quot;</span>;
<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span>percent<span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">loaded</span> == total<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">gotoAndPlay</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><strong>External SWF Movie Loader Actionscript</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
total = <span style="color: #0066CC;">_root</span>.<span style="color: #006600;">base1</span>.<span style="color: #0066CC;">getBytesTotal</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span>enterFrame<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">loaded</span> = <span style="color: #0066CC;">_root</span>.<span style="color: #006600;">base1</span>.<span style="color: #0066CC;">getBytesLoaded</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
percent = <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">loaded</span><span style="color: #66cc66;">/</span>total<span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">text</span> = percent+<span style="color: #ff0000;">&quot;%&quot;</span>;
<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span>percent<span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">loaded</span> == total<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">tellTarget</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">_root</span>.<span style="color: #006600;">base1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The <strong>base1</strong> is the target in which external movie will reside and when loading will be done <strong>base1</strong> will be played hence playing the externally loaded swf movie and not the main root itself. </p>
<p>* Note that you cant check that script in working state in the specific external movie you placed in, because it will search the <strong>base1</strong> and when you will play the container it will be working fine. All other movies which will come from outside will contain that second script in loader.<br />
Cheers !!!</p>
<p><span class="downloadfile"><a href='http://www.webstylepress.com/wp-content/uploads/2008/10/adv_loader.rar'>Advanced External SWF Movie Preloader Download</a></span></p>
<p><a href="http://www.webstylepress.com/flash-loader/">Flash ActionScript Preloaders &#8211; Tutorials and Downloads</a> is a post from: <a href="http://www.webstylepress.com">Web Style Press, Best Practices from all the Web, Build Better Websites</a></p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.webstylepress.com/load-external-files-into-flash/" title="Load External Files Into Flash">Load External Files Into Flash</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.webstylepress.com/flash-loader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

