<?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/"
		>
<channel>
	<title>Comments on: How to build an Object-Oriented ActionScript 3 Preloader in Flash CS4: 2 Methods</title>
	<atom:link href="http://blog.anselmbradford.com/2009/06/20/how-to-build-an-object-oriented-actionscript-3-preloader-in-flash-cs4-2-methods/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.anselmbradford.com/2009/06/20/how-to-build-an-object-oriented-actionscript-3-preloader-in-flash-cs4-2-methods/</link>
	<description>wrangling the Internet's wildest</description>
	<lastBuildDate>Wed, 10 Mar 2010 07:24:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ans</title>
		<link>http://blog.anselmbradford.com/2009/06/20/how-to-build-an-object-oriented-actionscript-3-preloader-in-flash-cs4-2-methods/comment-page-1/#comment-9254</link>
		<dc:creator>Ans</dc:creator>
		<pubDate>Thu, 11 Feb 2010 08:36:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=836#comment-9254</guid>
		<description>Hi Ryan, 

Thanks for the comment. It really depends on how large your combined swf would be. Loading in external swfs at runtime spreads the loading out, giving a better experience to the user, but it may well not be necessary if your total load size is small, and you&#039;ll actually be adding in code and complexity that isn&#039;t necessary in that case.</description>
		<content:encoded><![CDATA[<p>Hi Ryan, </p>
<p>Thanks for the comment. It really depends on how large your combined swf would be. Loading in external swfs at runtime spreads the loading out, giving a better experience to the user, but it may well not be necessary if your total load size is small, and you&#8217;ll actually be adding in code and complexity that isn&#8217;t necessary in that case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://blog.anselmbradford.com/2009/06/20/how-to-build-an-object-oriented-actionscript-3-preloader-in-flash-cs4-2-methods/comment-page-1/#comment-9250</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Thu, 11 Feb 2010 02:55:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=836#comment-9250</guid>
		<description>Thanks for the write-up Ans. Very useful =)

I have a query, though it&#039;s slightly off-topic, concerning generic OOP design in AS3. After you have incorporated a preloader using the first method, do you keep your main/container swf relatively empty and then load external swf&#039;s for the the actual content, ie, each page?

In AS2 I would always try to keep the size of the main swf as low as possible to speed up initial download and then load further content when required (working example: www.ahern.com.au). Though I am trying to work out how best maximise the power of AS3&#039;s OOP to achieve this. In your personal opinion, is it even worth loading it seperately like that? 

Wouldn&#039;t mind hearing other pps opinions on this also.

Thanks
Ryan</description>
		<content:encoded><![CDATA[<p>Thanks for the write-up Ans. Very useful =)</p>
<p>I have a query, though it&#8217;s slightly off-topic, concerning generic OOP design in AS3. After you have incorporated a preloader using the first method, do you keep your main/container swf relatively empty and then load external swf&#8217;s for the the actual content, ie, each page?</p>
<p>In AS2 I would always try to keep the size of the main swf as low as possible to speed up initial download and then load further content when required (working example: <a href="http://www.ahern.com.au" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.ahern.com.au?referer=');">http://www.ahern.com.au</a>). Though I am trying to work out how best maximise the power of AS3&#8217;s OOP to achieve this. In your personal opinion, is it even worth loading it seperately like that? </p>
<p>Wouldn&#8217;t mind hearing other pps opinions on this also.</p>
<p>Thanks<br />
Ryan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ans</title>
		<link>http://blog.anselmbradford.com/2009/06/20/how-to-build-an-object-oriented-actionscript-3-preloader-in-flash-cs4-2-methods/comment-page-1/#comment-5768</link>
		<dc:creator>Ans</dc:creator>
		<pubDate>Wed, 18 Nov 2009 02:44:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=836#comment-5768</guid>
		<description>Hi Mark,

Ahh yes, this is a classic one. What you want to do is add this line to your constructor:

&lt;code&gt;this.addEventListener( Event.ADDED_TO_STAGE , init );&lt;/code&gt;

And then create a method in your class:

&lt;code&gt;
private function init( evt:Event ) : void
{
	stage.align=StageAlign.TOP_LEFT;
	stage.scaleMode=StageScaleMode.NO_SCALE;
}
&lt;/code&gt;

This way the reference to the stage will only occur when the stage property has been set.</description>
		<content:encoded><![CDATA[<p>Hi Mark,</p>
<p>Ahh yes, this is a classic one. What you want to do is add this line to your constructor:</p>
<p><code>this.addEventListener( Event.ADDED_TO_STAGE , init );</code></p>
<p>And then create a method in your class:</p>
<p><code><br />
private function init( evt:Event ) : void<br />
{<br />
	stage.align=StageAlign.TOP_LEFT;<br />
	stage.scaleMode=StageScaleMode.NO_SCALE;<br />
}<br />
</code></p>
<p>This way the reference to the stage will only occur when the stage property has been set.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://blog.anselmbradford.com/2009/06/20/how-to-build-an-object-oriented-actionscript-3-preloader-in-flash-cs4-2-methods/comment-page-1/#comment-5752</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 17 Nov 2009 21:43:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=836#comment-5752</guid>
		<description>I solved my null object reference error by removing these lines from my main class constructor:

stage.align=StageAlign.TOP_LEFT;
stage.scaleMode=StageScaleMode.NO_SCALE;

It worked fine after that.  I guess &#039;stage&#039; was the null reference (?)</description>
		<content:encoded><![CDATA[<p>I solved my null object reference error by removing these lines from my main class constructor:</p>
<p>stage.align=StageAlign.TOP_LEFT;<br />
stage.scaleMode=StageScaleMode.NO_SCALE;</p>
<p>It worked fine after that.  I guess &#8217;stage&#8217; was the null reference (?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://blog.anselmbradford.com/2009/06/20/how-to-build-an-object-oriented-actionscript-3-preloader-in-flash-cs4-2-methods/comment-page-1/#comment-5741</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 17 Nov 2009 19:10:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=836#comment-5741</guid>
		<description>I&#039;m getting the null object reference too, but when I test my content SWF alone, I get no error.  How can this be?  I&#039;ve scanned my code for object variables, and they all are set properly as far as I can tell.</description>
		<content:encoded><![CDATA[<p>I&#8217;m getting the null object reference too, but when I test my content SWF alone, I get no error.  How can this be?  I&#8217;ve scanned my code for object variables, and they all are set properly as far as I can tell.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ans</title>
		<link>http://blog.anselmbradford.com/2009/06/20/how-to-build-an-object-oriented-actionscript-3-preloader-in-flash-cs4-2-methods/comment-page-1/#comment-5448</link>
		<dc:creator>Ans</dc:creator>
		<pubDate>Tue, 10 Nov 2009 16:33:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=836#comment-5448</guid>
		<description>Hi Arthur,

You get this from downloading and trying the source unmodified? I don&#039;t see this. Are you using Flash CS4?

I have a post on error #1009 by the way: http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/</description>
		<content:encoded><![CDATA[<p>Hi Arthur,</p>
<p>You get this from downloading and trying the source unmodified? I don&#8217;t see this. Are you using Flash CS4?</p>
<p>I have a post on error #1009 by the way: <a href="http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/" rel="nofollow">http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ans</title>
		<link>http://blog.anselmbradford.com/2009/06/20/how-to-build-an-object-oriented-actionscript-3-preloader-in-flash-cs4-2-methods/comment-page-1/#comment-5447</link>
		<dc:creator>Ans</dc:creator>
		<pubDate>Tue, 10 Nov 2009 16:29:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=836#comment-5447</guid>
		<description>Daaaa,

Hmm... yeah you have a syntax error somewhere, using &lt;code&gt;this&lt;/code&gt; should not throw an error.
Is your document class set to &lt;code&gt;PreloaderWrapper&lt;/code&gt;?</description>
		<content:encoded><![CDATA[<p>Daaaa,</p>
<p>Hmm&#8230; yeah you have a syntax error somewhere, using <code>this</code> should not throw an error.<br />
Is your document class set to <code>PreloaderWrapper</code>?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: arthur</title>
		<link>http://blog.anselmbradford.com/2009/06/20/how-to-build-an-object-oriented-actionscript-3-preloader-in-flash-cs4-2-methods/comment-page-1/#comment-5446</link>
		<dc:creator>arthur</dc:creator>
		<pubDate>Tue, 10 Nov 2009 16:13:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=836#comment-5446</guid>
		<description>Hi, I&#039;m learning AS3, moving on from AS2. Been away for a year traveling. I&#039;m wondering why is it that when I preview your preloader 1 solution, and I&#039;m simulating bandwith. (Basically Command + Enter) the second time I get:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at Main/_initContent()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at Preloader/_onCheckLoaded()</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m learning AS3, moving on from AS2. Been away for a year traveling. I&#8217;m wondering why is it that when I preview your preloader 1 solution, and I&#8217;m simulating bandwith. (Basically Command + Enter) the second time I get:</p>
<p>TypeError: Error #1009: Cannot access a property or method of a null object reference.<br />
	at Main/_initContent()<br />
	at flash.events::EventDispatcher/dispatchEventFunction()<br />
	at flash.events::EventDispatcher/dispatchEvent()<br />
	at Preloader/_onCheckLoaded()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pawel</title>
		<link>http://blog.anselmbradford.com/2009/06/20/how-to-build-an-object-oriented-actionscript-3-preloader-in-flash-cs4-2-methods/comment-page-1/#comment-5177</link>
		<dc:creator>Pawel</dc:creator>
		<pubDate>Thu, 05 Nov 2009 22:39:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=836#comment-5177</guid>
		<description>Nice. Good job</description>
		<content:encoded><![CDATA[<p>Nice. Good job</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daaaa</title>
		<link>http://blog.anselmbradford.com/2009/06/20/how-to-build-an-object-oriented-actionscript-3-preloader-in-flash-cs4-2-methods/comment-page-1/#comment-5136</link>
		<dc:creator>Daaaa</dc:creator>
		<pubDate>Wed, 04 Nov 2009 21:51:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=836#comment-5136</guid>
		<description>Thanks for the reply,

I am using Method 2, loader.swf is the Preloaderwrap and the movie.swf is the movie swf with flvplayer and animations in it.

I did add those codes in, but ends up showing errors because &quot;this&quot; isn&#039;t targeting to any instances. Not sure where I did wrong.

That is the point, to have it play only when it hits 100%. Right now, it acts like streaming behind the loader bar.</description>
		<content:encoded><![CDATA[<p>Thanks for the reply,</p>
<p>I am using Method 2, loader.swf is the Preloaderwrap and the movie.swf is the movie swf with flvplayer and animations in it.</p>
<p>I did add those codes in, but ends up showing errors because &#8220;this&#8221; isn&#8217;t targeting to any instances. Not sure where I did wrong.</p>
<p>That is the point, to have it play only when it hits 100%. Right now, it acts like streaming behind the loader bar.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
