<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: How do you create a Preloader with ActionScript 3 in Flash CS3?</title>
	<atom:link href="http://blog.hexagonstar.com/howto_create_preloader_with_as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hexagonstar.com/howto_create_preloader_with_as3/</link>
	<description>turn-based glory and pixel pleasure</description>
	<lastBuildDate>Fri, 03 Feb 2012 14:41:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: AleksandrRV</title>
		<link>http://blog.hexagonstar.com/howto_create_preloader_with_as3/#comment-2576</link>
		<dc:creator>AleksandrRV</dc:creator>
		<pubDate>Sat, 02 Jul 2011 13:35:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/how-do-you-create-a-preloader-with-actionscript-3-in-flash-cs3/#comment-2576</guid>
		<description>&lt;a href=&quot;#comment-631&quot; rel=&quot;nofollow&quot;&gt;@An Example &lt;/a&gt; 
Thank you very much!
It helped me</description>
		<content:encoded><![CDATA[<p><a href="#comment-631" rel="nofollow">@An Example </a><br />
Thank you very much!<br />
It helped me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Video Streamin</title>
		<link>http://blog.hexagonstar.com/howto_create_preloader_with_as3/#comment-648</link>
		<dc:creator>Video Streamin</dc:creator>
		<pubDate>Sun, 07 Mar 2010 15:17:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/how-do-you-create-a-preloader-with-actionscript-3-in-flash-cs3/#comment-648</guid>
		<description>This doesn&#039;t always work...

stop();

this.loaderInfo.addEventListener(Event.COMPLETE, initApplication);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);</description>
		<content:encoded><![CDATA[<p>This doesn&#8217;t always work&#8230;</p>
<p>stop();</p>
<p>this.loaderInfo.addEventListener(Event.COMPLETE, initApplication);<br />
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bichhoo2k</title>
		<link>http://blog.hexagonstar.com/howto_create_preloader_with_as3/#comment-647</link>
		<dc:creator>Bichhoo2k</dc:creator>
		<pubDate>Fri, 03 Jul 2009 14:59:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/how-do-you-create-a-preloader-with-actionscript-3-in-flash-cs3/#comment-647</guid>
		<description>Web / Graphics Designer</description>
		<content:encoded><![CDATA[<p>Web / Graphics Designer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: laura</title>
		<link>http://blog.hexagonstar.com/howto_create_preloader_with_as3/#comment-646</link>
		<dc:creator>laura</dc:creator>
		<pubDate>Sat, 20 Jun 2009 07:26:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/how-do-you-create-a-preloader-with-actionscript-3-in-flash-cs3/#comment-646</guid>
		<description>I think here it is!


http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&amp;file=00000818.html

At least partly a solution, but you can work from there</description>
		<content:encoded><![CDATA[<p>I think here it is!</p>
<p><a href="http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&#038;file=00000818.html" rel="nofollow">http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&#038;file=00000818.html</a></p>
<p>At least partly a solution, but you can work from there</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: laura</title>
		<link>http://blog.hexagonstar.com/howto_create_preloader_with_as3/#comment-645</link>
		<dc:creator>laura</dc:creator>
		<pubDate>Sat, 20 Jun 2009 07:23:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/how-do-you-create-a-preloader-with-actionscript-3-in-flash-cs3/#comment-645</guid>
		<description>There is something here
http://www.bit-101.com/blog/?p=946
, about this subject of class methods throwing an error when the mc have not been loaded
I don´t get it tought</description>
		<content:encoded><![CDATA[<p>There is something here<br />
<a href="http://www.bit-101.com/blog/?p=946" rel="nofollow">http://www.bit-101.com/blog/?p=946</a><br />
, about this subject of class methods throwing an error when the mc have not been loaded<br />
I don´t get it tought</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://blog.hexagonstar.com/howto_create_preloader_with_as3/#comment-644</link>
		<dc:creator>John</dc:creator>
		<pubDate>Fri, 10 Apr 2009 12:52:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/how-do-you-create-a-preloader-with-actionscript-3-in-flash-cs3/#comment-644</guid>
		<description>note that in the above example i had to remove the content from the stage and then re-add it to get it to initialize correctly.</description>
		<content:encoded><![CDATA[<p>note that in the above example i had to remove the content from the stage and then re-add it to get it to initialize correctly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://blog.hexagonstar.com/howto_create_preloader_with_as3/#comment-643</link>
		<dc:creator>John</dc:creator>
		<pubDate>Thu, 09 Apr 2009 20:55:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/how-do-you-create-a-preloader-with-actionscript-3-in-flash-cs3/#comment-643</guid>
		<description>i had code in my Flash file that had references to &quot;stage&quot; that weren&#039;t working correctly, so here&#039;s my fix.

i noticed that when you use addChild(), it doesn&#039;t initialize the SWF the same way it would if it were being executed directly (the stage reference gets weird). So I used the ADDED_TO_STAGE event (however this causes the movie to initialize twice!), so I put in a flag to tell it to only initialize the one time and it worked!

i created a  preloader flash movie has this code borrowed from http://www.gotoandlearn.com/play?id=85:

var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);

l.load(new URLRequest(&quot;main_content.swf&quot;));

function loop(e:ProgressEvent):void
{
	var perc:Number = e.bytesLoaded / e.bytesTotal;
	percent.text = Math.ceil(perc*100).toString();
}

function done(e:Event):void
{
	percent = null;
	stage.addChild(l);
}

then in my &quot;main_content&quot; flash file, the document class I contains the following:

package {

    public class main_content extends Sprite {

    public function main_content() {
        if(stage!=null) {
            // file is running without the preloader
            init();
        } else {
            // file is included by the preloader
            addEventListener(Event.ADDED_TO_STAGE,init);
        }
    }

    public function init(evt:Event=null) {
        if(!inited) {
            inited=true;
            if(stage.numChildren==2) {
                stage.removeChildAt(0);
                stage.addChild(this);
            }
        }
        // everything else here
    }

}</description>
		<content:encoded><![CDATA[<p>i had code in my Flash file that had references to &#8220;stage&#8221; that weren&#8217;t working correctly, so here&#8217;s my fix.</p>
<p>i noticed that when you use addChild(), it doesn&#8217;t initialize the SWF the same way it would if it were being executed directly (the stage reference gets weird). So I used the ADDED_TO_STAGE event (however this causes the movie to initialize twice!), so I put in a flag to tell it to only initialize the one time and it worked!</p>
<p>i created a  preloader flash movie has this code borrowed from <a href="http://www.gotoandlearn.com/play?id=85" rel="nofollow">http://www.gotoandlearn.com/play?id=85</a>:</p>
<p>var l:Loader = new Loader();<br />
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);<br />
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);</p>
<p>l.load(new URLRequest(&#8220;main_content.swf&#8221;));</p>
<p>function loop(e:ProgressEvent):void<br />
{<br />
	var perc:Number = e.bytesLoaded / e.bytesTotal;<br />
	percent.text = Math.ceil(perc*100).toString();<br />
}</p>
<p>function done(e:Event):void<br />
{<br />
	percent = null;<br />
	stage.addChild(l);<br />
}</p>
<p>then in my &#8220;main_content&#8221; flash file, the document class I contains the following:</p>
<p>package {</p>
<p>    public class main_content extends Sprite {</p>
<p>    public function main_content() {<br />
        if(stage!=null) {<br />
            // file is running without the preloader<br />
            init();<br />
        } else {<br />
            // file is included by the preloader<br />
            addEventListener(Event.ADDED_TO_STAGE,init);<br />
        }<br />
    }</p>
<p>    public function init(evt:Event=null) {<br />
        if(!inited) {<br />
            inited=true;<br />
            if(stage.numChildren==2) {<br />
                stage.removeChildAt(0);<br />
                stage.addChild(this);<br />
            }<br />
        }<br />
        // everything else here<br />
    }</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles</title>
		<link>http://blog.hexagonstar.com/howto_create_preloader_with_as3/#comment-642</link>
		<dc:creator>Charles</dc:creator>
		<pubDate>Thu, 09 Apr 2009 19:50:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/how-do-you-create-a-preloader-with-actionscript-3-in-flash-cs3/#comment-642</guid>
		<description>Thank you Rex!  That&#039;s exactly what I was looking for.  I never quite understood &quot;the catch&quot; until now.</description>
		<content:encoded><![CDATA[<p>Thank you Rex!  That&#8217;s exactly what I was looking for.  I never quite understood &#8220;the catch&#8221; until now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rex</title>
		<link>http://blog.hexagonstar.com/howto_create_preloader_with_as3/#comment-641</link>
		<dc:creator>Rex</dc:creator>
		<pubDate>Thu, 11 Dec 2008 20:19:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/how-do-you-create-a-preloader-with-actionscript-3-in-flash-cs3/#comment-641</guid>
		<description>I think the solution you&#039;re looking for sascha is mostly undocumented, but it exists:

Use a 3 frame main timeline to load any library assets, explained at:
http://www.8bitrocket.com/newsdisplay.aspx?newspage=10807

Here&#039;s the catch. No matter what frame is specified in the publish settings, Flash will always load the following in the first frame: (1) any custom document class (along w/ any classes imported in that document class), and (2) any classes imported on the main timeline (regardless of which frame they&#039;re imported on). The publish setting applies only to classes imported within MovieClips that are children of the main timeline. I tested this myself after reading it here:
http://summitprojectsflashblog.wordpress.com/2008/10/31/as3-class-export-frame-behavior/

So that means you have to contain your entire application within a MovieClip on the third frame (if using methods of the first link above). This clip could be assigned a class and treated like the root/document. Any classes you want to use during preloading on the first frame must be put in the real document class, or imported right on the main timeline in the first frame.

Stupid that preloading is such a problem, but this way you can deploy a single, self-contained swf with a preloader that works and is built with class files instead of messing with timelines and movieclips.</description>
		<content:encoded><![CDATA[<p>I think the solution you&#8217;re looking for sascha is mostly undocumented, but it exists:</p>
<p>Use a 3 frame main timeline to load any library assets, explained at:<br />
<a href="http://www.8bitrocket.com/newsdisplay.aspx?newspage=10807" rel="nofollow">http://www.8bitrocket.com/newsdisplay.aspx?newspage=10807</a></p>
<p>Here&#8217;s the catch. No matter what frame is specified in the publish settings, Flash will always load the following in the first frame: (1) any custom document class (along w/ any classes imported in that document class), and (2) any classes imported on the main timeline (regardless of which frame they&#8217;re imported on). The publish setting applies only to classes imported within MovieClips that are children of the main timeline. I tested this myself after reading it here:<br />
<a href="http://summitprojectsflashblog.wordpress.com/2008/10/31/as3-class-export-frame-behavior/" rel="nofollow">http://summitprojectsflashblog.wordpress.com/2008/10/31/as3-class-export-frame-behavior/</a></p>
<p>So that means you have to contain your entire application within a MovieClip on the third frame (if using methods of the first link above). This clip could be assigned a class and treated like the root/document. Any classes you want to use during preloading on the first frame must be put in the real document class, or imported right on the main timeline in the first frame.</p>
<p>Stupid that preloading is such a problem, but this way you can deploy a single, self-contained swf with a preloader that works and is built with class files instead of messing with timelines and movieclips.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee</title>
		<link>http://blog.hexagonstar.com/howto_create_preloader_with_as3/#comment-640</link>
		<dc:creator>Lee</dc:creator>
		<pubDate>Fri, 31 Oct 2008 09:07:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/how-do-you-create-a-preloader-with-actionscript-3-in-flash-cs3/#comment-640</guid>
		<description>Preloading in AS3 is easier then we have all made it out to be. Simply create a new FLA file that imports your current SWF. You new movie should contain code like the following:

// Create a new Loader and URLRequest class
// Look at Flash&#039;s help file to learn more
var l:Loader = new Loader();
var request:URLRequest = new URLRequest(&quot;bigMovie.swf&quot;);
// Now we assign a listener to fire when bytes are recieved which will run a function everytime this happens
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
// Asign a listener and a function to the COMPLETE event to basically start our movie
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
// Now load your external asset
l.load(request);
// Function to handle Preloader updating
function loop(evt:ProgressEvent):void {
	var perc:Number = evt.bytesLoaded/evt.bytesTotal;
	// I have a text field on frame 1 named percent to show download progress
        percent.text = Math.ceil(perc*100).toString();
}

function done(evt:Event):void {
        // We are done preloading so ditch the text field
	removeChildAt(0);
	percent = null
        // Add our loader to the display list
	stage.addChild(l);

}

You will of course want to include a Event.ADDED_TO_STAGE listener in there somewhere so your movie can instantiate itself somehow,someway.

You can thank our good friend Lee Brimelow (www.theflashbog.com) for this one. He has a very in depth video tutorial and I recommend you follow it.</description>
		<content:encoded><![CDATA[<p>Preloading in AS3 is easier then we have all made it out to be. Simply create a new FLA file that imports your current SWF. You new movie should contain code like the following:</p>
<p>// Create a new Loader and URLRequest class<br />
// Look at Flash&#8217;s help file to learn more<br />
var l:Loader = new Loader();<br />
var request:URLRequest = new URLRequest(&#8220;bigMovie.swf&#8221;);<br />
// Now we assign a listener to fire when bytes are recieved which will run a function everytime this happens<br />
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);<br />
// Asign a listener and a function to the COMPLETE event to basically start our movie<br />
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);<br />
// Now load your external asset<br />
l.load(request);<br />
// Function to handle Preloader updating<br />
function loop(evt:ProgressEvent):void {<br />
	var perc:Number = evt.bytesLoaded/evt.bytesTotal;<br />
	// I have a text field on frame 1 named percent to show download progress<br />
        percent.text = Math.ceil(perc*100).toString();<br />
}</p>
<p>function done(evt:Event):void {<br />
        // We are done preloading so ditch the text field<br />
	removeChildAt(0);<br />
	percent = null<br />
        // Add our loader to the display list<br />
	stage.addChild(l);</p>
<p>}</p>
<p>You will of course want to include a Event.ADDED_TO_STAGE listener in there somewhere so your movie can instantiate itself somehow,someway.</p>
<p>You can thank our good friend Lee Brimelow (www.theflashbog.com) for this one. He has a very in depth video tutorial and I recommend you follow it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

