<?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"
	>
<channel>
	<title>Comments on: Actionscript 3 Preloader</title>
	<atom:link href="http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/</link>
	<description>There is no universally agreed-upon biological definition of dreaming</description>
	<pubDate>Fri, 21 Nov 2008 09:09:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Chris S</title>
		<link>http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-276</link>
		<dc:creator>Chris S</dc:creator>
		<pubDate>Sat, 12 Apr 2008 21:37:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-276</guid>
		<description>Hi Idoru,

Thanks for your feedback. Yeah, I've abandoned hope of getting it to work in CS3, since it doesn't support the [Embde...] tag. I'm now focussing on getting it to work with mxmlc. Another problem I found was the [Frame...] tag also had a ";", which blocked the preloader, but now that's fixed.

Unfortunately, I'm 100% certain your code as-is does not update the status. You can see this for yourself by using ExternalInterface to write to the percent to Firebug's console.log. For example:

ExternalInterface.call("console.log", 'onenterframe loading:'+percent)

You'll see that only executes once. However, I did find how to make your code correctly update status, by adding these lines to the preloader's constructor:

this.loaderInfo.addEventListener(Event.INIT, onEnterFrame);
			this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onEnterFrame);
			this.loaderInfo.addEventListener(Event.COMPLETE, onEnterFrame);

With these lines, Firebug shows the status percent being updated correctly. However, for some reason the graphics are not being refreshed. Even though the percent changes, all I see is the first status update where it's only at about 30%.

Can you think of any reason for this?</description>
		<content:encoded><![CDATA[<p>Hi Idoru,</p>
<p>Thanks for your feedback. Yeah, I&#8217;ve abandoned hope of getting it to work in CS3, since it doesn&#8217;t support the [Embde...] tag. I&#8217;m now focussing on getting it to work with mxmlc. Another problem I found was the [Frame...] tag also had a &#8220;;&#8221;, which blocked the preloader, but now that&#8217;s fixed.</p>
<p>Unfortunately, I&#8217;m 100% certain your code as-is does not update the status. You can see this for yourself by using ExternalInterface to write to the percent to Firebug&#8217;s console.log. For example:</p>
<p>ExternalInterface.call(&#8221;console.log&#8221;, &#8216;onenterframe loading:&#8217;+percent)</p>
<p>You&#8217;ll see that only executes once. However, I did find how to make your code correctly update status, by adding these lines to the preloader&#8217;s constructor:</p>
<p>this.loaderInfo.addEventListener(Event.INIT, onEnterFrame);<br />
			this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onEnterFrame);<br />
			this.loaderInfo.addEventListener(Event.COMPLETE, onEnterFrame);</p>
<p>With these lines, Firebug shows the status percent being updated correctly. However, for some reason the graphics are not being refreshed. Even though the percent changes, all I see is the first status update where it&#8217;s only at about 30%.</p>
<p>Can you think of any reason for this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Idoru</title>
		<link>http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-275</link>
		<dc:creator>Idoru</dc:creator>
		<pubDate>Sat, 12 Apr 2008 21:07:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-275</guid>
		<description>Hi Chris,
I'm pretty sure everything works fine and it does update the status bar, but I have no idea of what will happen when you use this code in CS3, because CS3 and Flex have different ways of compiling the swf. This is essentially adding a frame to to the swf, which in Flex is a bit harder because of not having all that timeline stuff. I have no idea how to achieve the same functionality on CS3. Plus you can check that the onEnterframe does get called as it's a listener, I think that you must have embbeded the image on the first frame and not on the second, hence causing the preloader not to show.

But thank you for the comments and for the feedback, I will try and get a CS3 version working though.</description>
		<content:encoded><![CDATA[<p>Hi Chris,<br />
I&#8217;m pretty sure everything works fine and it does update the status bar, but I have no idea of what will happen when you use this code in CS3, because CS3 and Flex have different ways of compiling the swf. This is essentially adding a frame to to the swf, which in Flex is a bit harder because of not having all that timeline stuff. I have no idea how to achieve the same functionality on CS3. Plus you can check that the onEnterframe does get called as it&#8217;s a listener, I think that you must have embbeded the image on the first frame and not on the second, hence causing the preloader not to show.</p>
<p>But thank you for the comments and for the feedback, I will try and get a CS3 version working though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris S</title>
		<link>http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-274</link>
		<dc:creator>Chris S</dc:creator>
		<pubDate>Sat, 12 Apr 2008 20:51:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-274</guid>
		<description>Btw, I'm pretty sure this code doesn't update status, at all. onEnterFrame() will only be called once, not for every progress update, so your status bar will never get shown. I verified this by compiling an example with a 100MB image, and no status bar was ever shown. You should probably combine your code with the example at http://newmovieclip.wordpress.com/2007/03/14/preloader-in-flash-cs3-actionscript-30-way/</description>
		<content:encoded><![CDATA[<p>Btw, I&#8217;m pretty sure this code doesn&#8217;t update status, at all. onEnterFrame() will only be called once, not for every progress update, so your status bar will never get shown. I verified this by compiling an example with a 100MB image, and no status bar was ever shown. You should probably combine your code with the example at <a href="http://newmovieclip.wordpress.com/2007/03/14/preloader-in-flash-cs3-actionscript-30-way/" rel="nofollow">http://newmovieclip.wordpress.com/2007/03/14/preloader-in-flash-cs3-actionscript-30-way/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris S</title>
		<link>http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-273</link>
		<dc:creator>Chris S</dc:creator>
		<pubDate>Sat, 12 Apr 2008 20:26:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-273</guid>
		<description>In response to the "Embed is only supported on..." error, I figured that one out. Turns out I made the mistake of using Flash CS3's "auto format" tool, which puts a ";" at the end of the [Embed...], which is of course a formatting error.</description>
		<content:encoded><![CDATA[<p>In response to the &#8220;Embed is only supported on&#8230;&#8221; error, I figured that one out. Turns out I made the mistake of using Flash CS3&#8217;s &#8220;auto format&#8221; tool, which puts a &#8220;;&#8221; at the end of the [Embed...], which is of course a formatting error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris S</title>
		<link>http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-272</link>
		<dc:creator>Chris S</dc:creator>
		<pubDate>Sat, 12 Apr 2008 20:12:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-272</guid>
		<description>When I tried to compile with mxmlc, I got the compile-time error:
Main.as(11): col: 4: Error: Embed is only supported on classes and member variables.</description>
		<content:encoded><![CDATA[<p>When I tried to compile with mxmlc, I got the compile-time error:<br />
Main.as(11): col: 4: Error: Embed is only supported on classes and member variables.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris S</title>
		<link>http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-271</link>
		<dc:creator>Chris S</dc:creator>
		<pubDate>Sat, 12 Apr 2008 20:04:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-271</guid>
		<description>When I try to compile this in Flash CS3, I get the runtime error:
TypeError: Error #1007: Instantiation attempted on a non-constructor.
	at Main/::init()
	at Main$iinit()

I added the Flex SDK to Flash CS3's classpath. Is there anything else needed to get this to work in CS3, or is this code inherently specific to Flex?</description>
		<content:encoded><![CDATA[<p>When I try to compile this in Flash CS3, I get the runtime error:<br />
TypeError: Error #1007: Instantiation attempted on a non-constructor.<br />
	at Main/::init()<br />
	at Main$iinit()</p>
<p>I added the Flex SDK to Flash CS3&#8217;s classpath. Is there anything else needed to get this to work in CS3, or is this code inherently specific to Flex?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris S</title>
		<link>http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-270</link>
		<dc:creator>Chris S</dc:creator>
		<pubDate>Sat, 12 Apr 2008 18:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-270</guid>
		<description>Wow, thanks for the post! I've been searching everywhere for something like this, and everyone seems to implement preloaders via some awkard tweening and inline coding with CS3. It's nice to see someone properly implementing it in real code.</description>
		<content:encoded><![CDATA[<p>Wow, thanks for the post! I&#8217;ve been searching everywhere for something like this, and everyone seems to implement preloaders via some awkard tweening and inline coding with CS3. It&#8217;s nice to see someone properly implementing it in real code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dreaming in Flash &#187; Blog Archive &#187; Giving Flex Builder a Library (SWC)</title>
		<link>http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-210</link>
		<dc:creator>Dreaming in Flash &#187; Blog Archive &#187; Giving Flex Builder a Library (SWC)</dc:creator>
		<pubDate>Wed, 27 Feb 2008 16:55:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-210</guid>
		<description>[...] Have you ever wondered why Flex doesn't have a nice library like Flash IDE? You'd love to use Flex but not having that nice little library there puts you off? Well here's how we do it: First create your FLA file, then create all the items you want inside (they don't need to be on stage just library will do), be sure to tick 'export for actionscript' and 'export in firstframe', also you can change the base class to something else that will add functionality to your movieclip. Then in export preferences, tick 'export swc'. Ok so now we have a nice little SWC file, how do we get it into Flex? Easy  Open project properties, go to Build Path &#62; Library Path and add your SWC file. That's it! Congratulations now you have auto complete goodness on your AS3 Flex Builder application  Just keep in mind that these elements will be exported in the initial load of your website, so if you want to preload them be sure to use the preloader. [...]</description>
		<content:encoded><![CDATA[<p>[...] Have you ever wondered why Flex doesn&#8217;t have a nice library like Flash IDE? You&#8217;d love to use Flex but not having that nice little library there puts you off? Well here&#8217;s how we do it: First create your FLA file, then create all the items you want inside (they don&#8217;t need to be on stage just library will do), be sure to tick &#8216;export for actionscript&#8217; and &#8216;export in firstframe&#8217;, also you can change the base class to something else that will add functionality to your movieclip. Then in export preferences, tick &#8216;export swc&#8217;. Ok so now we have a nice little SWC file, how do we get it into Flex? Easy  Open project properties, go to Build Path &gt; Library Path and add your SWC file. That&#8217;s it! Congratulations now you have auto complete goodness on your AS3 Flex Builder application  Just keep in mind that these elements will be exported in the initial load of your website, so if you want to preload them be sure to use the preloader. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Idoru</title>
		<link>http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-205</link>
		<dc:creator>Idoru</dc:creator>
		<pubDate>Mon, 25 Feb 2008 08:14:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-205</guid>
		<description>Hi Lestaat, as far as I know you can't pass arguments in the meta tag, what you can do is pass parameters in the default-html so that you have your application class there as a variable, other than that you can create as many frames as you want using another frame tag with factoryClass or with extraClass, this should solve your problem. If you need any code example please do ask.

Cheers.</description>
		<content:encoded><![CDATA[<p>Hi Lestaat, as far as I know you can&#8217;t pass arguments in the meta tag, what you can do is pass parameters in the default-html so that you have your application class there as a variable, other than that you can create as many frames as you want using another frame tag with factoryClass or with extraClass, this should solve your problem. If you need any code example please do ask.</p>
<p>Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lestaat</title>
		<link>http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-204</link>
		<dc:creator>Lestaat</dc:creator>
		<pubDate>Sun, 24 Feb 2008 19:17:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2007/11/13/actionscript-3-preloader/#comment-204</guid>
		<description>Hi all,
is it possible to pass an argument to the factory?
It's just to make the code "BEAUTYFULL" i know, but i'd like to use the this way without copy MyFactory class in order to change ONLY the name of the mainclass
:P
I've try extending MyFactory class setting the name of mainclass on it and embedding [Frame(factoryClass="ExtensionOfMyFactoryClass")] but it seems that when getting definition by name in superclass look for mainclass in the same folder of the superclass instead of extended one.
I know it's a really stupid thing but i'd like to solve this problem :)
Any ideas?</description>
		<content:encoded><![CDATA[<p>Hi all,<br />
is it possible to pass an argument to the factory?<br />
It&#8217;s just to make the code &#8220;BEAUTYFULL&#8221; i know, but i&#8217;d like to use the this way without copy MyFactory class in order to change ONLY the name of the mainclass<br />
 <img src='http://www.dreaminginflash.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
I&#8217;ve try extending MyFactory class setting the name of mainclass on it and embedding [Frame(factoryClass="ExtensionOfMyFactoryClass")] but it seems that when getting definition by name in superclass look for mainclass in the same folder of the superclass instead of extended one.<br />
I know it&#8217;s a really stupid thing but i&#8217;d like to solve this problem <img src='http://www.dreaminginflash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Any ideas?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
