<?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: Bumpslide App Template</title>
	<atom:link href="http://bumpslide.com/blog/2008/11/06/bumpslide-app-template/feed/" rel="self" type="application/rss+xml" />
	<link>http://bumpslide.com/blog/2008/11/06/bumpslide-app-template/</link>
	<description></description>
	<lastBuildDate>Wed, 11 Nov 2009 15:24:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: freemind</title>
		<link>http://bumpslide.com/blog/2008/11/06/bumpslide-app-template/comment-page-1/#comment-28524</link>
		<dc:creator>freemind</dc:creator>
		<pubDate>Sat, 28 Mar 2009 18:34:18 +0000</pubDate>
		<guid isPermaLink="false">http://bumpslide.com/blog/?p=57#comment-28524</guid>
		<description>cheers david!

big thank u for the bumpslide library and the app template :)
having a pureMVC background (always trying to use the appropriate
approach for each project) i have to say your library is really cool ;)

the things you mentioned regarding the command pattern sound
interesting... would really appreciate an additional app template that
uses commands to see how you implement the command pattern.

keep up the good work!!</description>
		<content:encoded><![CDATA[<p>cheers david!</p>
<p>big thank u for the bumpslide library and the app template :)<br />
having a pureMVC background (always trying to use the appropriate<br />
approach for each project) i have to say your library is really cool ;)</p>
<p>the things you mentioned regarding the command pattern sound<br />
interesting&#8230; would really appreciate an additional app template that<br />
uses commands to see how you implement the command pattern.</p>
<p>keep up the good work!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david</title>
		<link>http://bumpslide.com/blog/2008/11/06/bumpslide-app-template/comment-page-1/#comment-28303</link>
		<dc:creator>david</dc:creator>
		<pubDate>Fri, 06 Feb 2009 06:59:40 +0000</pubDate>
		<guid isPermaLink="false">http://bumpslide.com/blog/?p=57#comment-28303</guid>
		<description>Wayne, note that binding events don&#039;t fire unless the value actually changes.  Beyond that, I&#039;d have to see code.</description>
		<content:encoded><![CDATA[<p>Wayne, note that binding events don&#8217;t fire unless the value actually changes.  Beyond that, I&#8217;d have to see code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david</title>
		<link>http://bumpslide.com/blog/2008/11/06/bumpslide-app-template/comment-page-1/#comment-28302</link>
		<dc:creator>david</dc:creator>
		<pubDate>Fri, 06 Feb 2009 06:56:09 +0000</pubDate>
		<guid isPermaLink="false">http://bumpslide.com/blog/?p=57#comment-28302</guid>
		<description>Ben, the problem here is that you&#039;re trying to resize the loader before it&#039;s loaded.  Ok, the real problem is that when resizing a loader, the resize method resizes loader.content.  The null reference error is coming when loader.content is null.  I should put a check in there for that.  Meanwhile, in your draw method, make sure the loader is loaded.</description>
		<content:encoded><![CDATA[<p>Ben, the problem here is that you&#8217;re trying to resize the loader before it&#8217;s loaded.  Ok, the real problem is that when resizing a loader, the resize method resizes loader.content.  The null reference error is coming when loader.content is null.  I should put a check in there for that.  Meanwhile, in your draw method, make sure the loader is loaded.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wayne</title>
		<link>http://bumpslide.com/blog/2008/11/06/bumpslide-app-template/comment-page-1/#comment-28299</link>
		<dc:creator>Wayne</dc:creator>
		<pubDate>Thu, 05 Feb 2009 21:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://bumpslide.com/blog/?p=57#comment-28299</guid>
		<description>David, sorry to be a bug! one more issue I&#039;m having.. per this suggestion from you:

&quot;Then, once assets are loaded, set model.assetsLoaded = true. In your assetsLoaded setter, if assetsLoaded is being set to true and model.requestedSection&gt;1, model.section = model.requestedSection.&quot;

In my assetsLoaded setter I&#039;m doing exactly this, to no avail. The strange thing is if I replace requestedSection with a literal value, (this.section = 2), it works. But trying to assign it to a variable value (this.section = this.requestedSection) doesn&#039;t work, even though the value will trace correctly.

Any ideas on this?</description>
		<content:encoded><![CDATA[<p>David, sorry to be a bug! one more issue I&#8217;m having.. per this suggestion from you:</p>
<p>&#8220;Then, once assets are loaded, set model.assetsLoaded = true. In your assetsLoaded setter, if assetsLoaded is being set to true and model.requestedSection&gt;1, model.section = model.requestedSection.&#8221;</p>
<p>In my assetsLoaded setter I&#8217;m doing exactly this, to no avail. The strange thing is if I replace requestedSection with a literal value, (this.section = 2), it works. But trying to assign it to a variable value (this.section = this.requestedSection) doesn&#8217;t work, even though the value will trace correctly.</p>
<p>Any ideas on this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben McMaster</title>
		<link>http://bumpslide.com/blog/2008/11/06/bumpslide-app-template/comment-page-1/#comment-28293</link>
		<dc:creator>Ben McMaster</dc:creator>
		<pubDate>Wed, 04 Feb 2009 21:39:26 +0000</pubDate>
		<guid isPermaLink="false">http://bumpslide.com/blog/?p=57#comment-28293</guid>
		<description>David, I am using the ImageUtil. I am getting a type error, yet my code and your code looks fine to me...


public function loadPic(url:String):void {
    loader.load( new URLRequest( url ), new LoaderContext( true ));
    loader.contentLoaderInfo.addEventListener(Event.INIT, onImageLoaded );
    loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
    addChild(loader);
    loader.x = 4;
    loader.y = 4;
}
		
private function onImageLoaded(event:Event):void{
    ImageUtil.resize(loader, 398, 398, false);
}

error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at com.bumpslide.util::ImageUtil$/resize()
	at app.view::PagePic/app.view:PagePic::draw()
	at com.bumpslide.ui::Component/updateNow()

I initialized the loader in the constructor.

Thoughts?</description>
		<content:encoded><![CDATA[<p>David, I am using the ImageUtil. I am getting a type error, yet my code and your code looks fine to me&#8230;</p>
<p>public function loadPic(url:String):void {<br />
    loader.load( new URLRequest( url ), new LoaderContext( true ));<br />
    loader.contentLoaderInfo.addEventListener(Event.INIT, onImageLoaded );<br />
    loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);<br />
    addChild(loader);<br />
    loader.x = 4;<br />
    loader.y = 4;<br />
}</p>
<p>private function onImageLoaded(event:Event):void{<br />
    ImageUtil.resize(loader, 398, 398, false);<br />
}</p>
<p>error:</p>
<p>TypeError: Error #1009: Cannot access a property or method of a null object reference.<br />
	at com.bumpslide.util::ImageUtil$/resize()<br />
	at app.view::PagePic/app.view:PagePic::draw()<br />
	at com.bumpslide.ui::Component/updateNow()</p>
<p>I initialized the loader in the constructor.</p>
<p>Thoughts?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wayne</title>
		<link>http://bumpslide.com/blog/2008/11/06/bumpslide-app-template/comment-page-1/#comment-28290</link>
		<dc:creator>Wayne</dc:creator>
		<pubDate>Wed, 04 Feb 2009 01:16:05 +0000</pubDate>
		<guid isPermaLink="false">http://bumpslide.com/blog/?p=57#comment-28290</guid>
		<description>Thanks, that helps a lot.</description>
		<content:encoded><![CDATA[<p>Thanks, that helps a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david</title>
		<link>http://bumpslide.com/blog/2008/11/06/bumpslide-app-template/comment-page-1/#comment-28289</link>
		<dc:creator>david</dc:creator>
		<pubDate>Wed, 04 Feb 2009 00:40:27 +0000</pubDate>
		<guid isPermaLink="false">http://bumpslide.com/blog/?p=57#comment-28289</guid>
		<description>Wayne, if it has display elements, it&#039;s a view.  Think of it like a top level section.  Section 0 is asset loader.  Section 1 is homepage, etc.  Once you have your model and configs initialized, init your MainView and go to section 0.  Section 0 should trigger a view where you can do your preloading and whatever you want.  Once  done, model.section=1.  This should then take you to the homepage.  

A more robust approach... You could also have a flag in your model like assetsLoaded (boolean).  If deep-linking to section 2 and assetsLoaded is false, go to section 0, and save a reference to your deep-linked path (model.requestedSection=2).  Then, once assets are loaded, set model.assetsLoaded = true.  In your assetsLoaded setter, if assetsLoaded is being set to true and model.requestedSection&gt;1, model.section = model.requestedSection.    

The key to command-less MVC is to put logic in those bindable model setters.  Have UI events trigger state changes on the model, and let the model sort things out.  Model is the new controller.

When this gets messy, start using commands to encapsulate business logic.  </description>
		<content:encoded><![CDATA[<p>Wayne, if it has display elements, it&#8217;s a view.  Think of it like a top level section.  Section 0 is asset loader.  Section 1 is homepage, etc.  Once you have your model and configs initialized, init your MainView and go to section 0.  Section 0 should trigger a view where you can do your preloading and whatever you want.  Once  done, model.section=1.  This should then take you to the homepage.  </p>
<p>A more robust approach&#8230; You could also have a flag in your model like assetsLoaded (boolean).  If deep-linking to section 2 and assetsLoaded is false, go to section 0, and save a reference to your deep-linked path (model.requestedSection=2).  Then, once assets are loaded, set model.assetsLoaded = true.  In your assetsLoaded setter, if assetsLoaded is being set to true and model.requestedSection>1, model.section = model.requestedSection.    </p>
<p>The key to command-less MVC is to put logic in those bindable model setters.  Have UI events trigger state changes on the model, and let the model sort things out.  Model is the new controller.</p>
<p>When this gets messy, start using commands to encapsulate business logic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wayne</title>
		<link>http://bumpslide.com/blog/2008/11/06/bumpslide-app-template/comment-page-1/#comment-28288</link>
		<dc:creator>Wayne</dc:creator>
		<pubDate>Wed, 04 Feb 2009 00:21:35 +0000</pubDate>
		<guid isPermaLink="false">http://bumpslide.com/blog/?p=57#comment-28288</guid>
		<description>David, I&#039;m finally getting around to trying out your template. One question, from an MVC newbie, I&#039;m going to be integrating a preloader for assets based on XML content. I&#039;m not sure how to fit the preload code into the startup sequence.. it&#039;s not exactly a view, but it has display elements. any advice or suggestions?</description>
		<content:encoded><![CDATA[<p>David, I&#8217;m finally getting around to trying out your template. One question, from an MVC newbie, I&#8217;m going to be integrating a preloader for assets based on XML content. I&#8217;m not sure how to fit the preload code into the startup sequence.. it&#8217;s not exactly a view, but it has display elements. any advice or suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david</title>
		<link>http://bumpslide.com/blog/2008/11/06/bumpslide-app-template/comment-page-1/#comment-28275</link>
		<dc:creator>david</dc:creator>
		<pubDate>Fri, 23 Jan 2009 07:45:30 +0000</pubDate>
		<guid isPermaLink="false">http://bumpslide.com/blog/?p=57#comment-28275</guid>
		<description>sorry, ben.  I messed up.  The binding needs to be like this.
[as]model.bind( &#039;sections&#039;, this, onSectionDataLoaded );[/as]

And, really, that onSectionDataLoaded handler will be receiving an Array, so you can type the sdata parameter as such.  But, I guess you don&#039;t really need it here assuming you are updating the model from your service class.

Code sample above has been updated.</description>
		<content:encoded><![CDATA[<p>sorry, ben.  I messed up.  The binding needs to be like this.</p>
<div class="igBar"><span id="lactionscript-1"><a href="#" onclick="javascript:showPlainTxt('actionscript-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-1">
<div class="actionscript">
<ol>
<li style="color:#666666;">
<div style="">model.<span style="color: #006600;">bind</span><span style="color: #66cc66;">&#40;</span> <span style="color: #990000;">'sections'</span>, <span style="color: #0066CC;">this</span>, onSectionDataLoaded <span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>And, really, that onSectionDataLoaded handler will be receiving an Array, so you can type the sdata parameter as such.  But, I guess you don't really need it here assuming you are updating the model from your service class.</p>
<p>Code sample above has been updated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://bumpslide.com/blog/2008/11/06/bumpslide-app-template/comment-page-1/#comment-28274</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 22 Jan 2009 23:41:33 +0000</pubDate>
		<guid isPermaLink="false">http://bumpslide.com/blog/?p=57#comment-28274</guid>
		<description>I just tried your first suggestion. I am getting a Binding Error. Here is my code:

[as]	
function Controller( appRoot:DisplayObjectContainer, callback:Function ) {
        	
   view = appRoot;
   _callback = callback;
        	
   // pass flashvars to app configuration in model
   model.config = new Config(getFlashVars());	
			
   // Bind model.sections
   // Should wait for xml to be loaded to call notifyComplete()
   model.bind( &#039;sections&#039;, onSectionDataLoaded );
			
   service.loadSiteXML();
}
		
function onSectionDataLoaded(sdata:*):void {
   trace(&quot;Calling notifyComplete()&quot;);
   notifyComplete();
}[/as]

Then I got this error:

[Binding Error] Error #1056: Cannot create property sections on builtin.as$0.MethodClosure.
ReferenceError: Error #1056: Cannot create property sections on builtin.as$0.MethodClosure.
	at com.bumpslide.data::Binding/::executeBinding()
	at com.bumpslide.data::Binding$iinit()
	at com.bumpslide.data::Binding$/create()
	at com.bumpslide.data::BindableModel/bind()
	at app::Controller$iinit()
	at app::AppRoot/app:AppRoot::onAddedToStage()

Any thoughts?</description>
		<content:encoded><![CDATA[<p>I just tried your first suggestion. I am getting a Binding Error. Here is my code:</p>
<div class="igBar"><span id="lactionscript-2"><a href="#" onclick="javascript:showPlainTxt('actionscript-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-2">
<div class="actionscript">
<ol>
<li style="color:#666666;">
<div style=""><span style="color: #000000;">function</span> Controller<span style="color: #66cc66;">&#40;</span> appRoot:DisplayObjectContainer, callback:<span style="color: #000000;">Function</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="color:#26536A;">
<div style="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="color:#666666;">
<div style="">&nbsp; &nbsp;view = appRoot;</div>
</li>
<li style="color:#26536A;">
<div style="">&nbsp; &nbsp;_callback = callback;</div>
</li>
<li style="color:#666666;">
<div style="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="color:#26536A;">
<div style="">&nbsp; &nbsp;<span style="color: #808080; font-style: italic;">// pass flashvars to app configuration in model</span></div>
</li>
<li style="color:#666666;">
<div style="">&nbsp; &nbsp;model.<span style="color: #006600;">config</span> = <span style="color: #000000;">new</span> Config<span style="color: #66cc66;">&#40;</span>getFlashVars<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp;</div>
</li>
<li style="color:#26536A;">
<div style="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="color:#666666;">
<div style="">&nbsp; &nbsp;<span style="color: #808080; font-style: italic;">// Bind model.sections</span></div>
</li>
<li style="color:#26536A;">
<div style="">&nbsp; &nbsp;<span style="color: #808080; font-style: italic;">// Should wait for xml to be loaded to call notifyComplete()</span></div>
</li>
<li style="color:#666666;">
<div style="">&nbsp; &nbsp;model.<span style="color: #006600;">bind</span><span style="color: #66cc66;">&#40;</span> <span style="color: #990000;">'sections'</span>, onSectionDataLoaded <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="color:#26536A;">
<div style="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="color:#666666;">
<div style="">&nbsp; &nbsp;service.<span style="color: #006600;">loadSiteXML</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="color:#666666;">
<div style="">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #000000;">function</span> onSectionDataLoaded<span style="color: #66cc66;">&#40;</span>sdata:*<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="color:#666666;">
<div style="">&nbsp; &nbsp;<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #990000;">"Calling notifyComplete()"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="color:#26536A;">
<div style="">&nbsp; &nbsp;notifyComplete<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="color:#666666;">
<div style=""><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Then I got this error:</p>
<p>[Binding Error] Error #1056: Cannot create property sections on builtin.as$0.MethodClosure.<br />
ReferenceError: Error #1056: Cannot create property sections on builtin.as$0.MethodClosure.<br />
	at com.bumpslide.data::Binding/::executeBinding()<br />
	at com.bumpslide.data::Binding$iinit()<br />
	at com.bumpslide.data::Binding$/create()<br />
	at com.bumpslide.data::BindableModel/bind()<br />
	at app::Controller$iinit()<br />
	at app::AppRoot/app:AppRoot::onAddedToStage()</p>
<p>Any thoughts?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

