<?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>zedia flash blog &#187; template</title>
	<atom:link href="http://www.zedia.net/tag/template/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zedia.net</link>
	<description>Flash, ActionScript, SEO and everything in between</description>
	<lastBuildDate>Thu, 02 Feb 2012 17:58:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>And now an AS3 Project &#8211; Robotlegs project template for FlashDevelop</title>
		<link>http://www.zedia.net/2010/and-now-an-as3-project-robotlegs-project-template-for-flashdevelop/</link>
		<comments>http://www.zedia.net/2010/and-now-an-as3-project-robotlegs-project-template-for-flashdevelop/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 18:04:14 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Robotlegs]]></category>
		<category><![CDATA[FlashDevelop]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=561</guid>
		<description><![CDATA[So yesterday I gave you files templates for Robotlegs. I now give you a project template. File templates are used when you want to add a new file to a project, project templates are used at the creation of a project. It will create the folder structure, add libraries and create the basic files you will need [...]]]></description>
			<content:encoded><![CDATA[<p>So yesterday I gave you <a title="Robotlegs files templates for FlashDevelop" href="http://www.zedia.net/2010/robotlegs-templates-for-flashdevelop/" target="_self">files templates for Robotlegs</a>. I now give you a project template. File templates are used when you want to add a new file to a project, project templates are used at the creation of a project. It will create the folder structure, add libraries and create the basic files you will need in most projects of that type.</p>
<p>In this <a title="Robotlegs framewrok" href="http://www.robotlegs.org/" target="_blank">Robotlegs</a> project template I added 7 files : Preload.fla, Main.as, IMain.as, MainContext.as, CreateModelsCommand.as, CreateMediatorsCommand.as and ApplicationModel.as.</p>
<p>I added the Preload.fla because <a href="http://www.zedia.net/2010/more-on-preloaders-passing-the-loaderinfo/" targe="_self">has explained in this post</a>, I pass the loaderInfo(I do this to pass the flashvars) from the preloader to the loaded Main so I thought it would make understanding why I did that in the Main easier. This is a template preloader so there is no graphics in it, just the basic code to make a preloader work.</p>
<p>In the Main.as I also do some weird things, namely this:</p>

<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;">Capabilities</span>.<span style="color: #0066CC;">playerType</span> == <span style="color: #ff0000;">&quot;StandAlone&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">scaleMode</span> = StageScaleMode.<span style="color: #006600;">NO_SCALE</span>;
<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">align</span> = StageAlign.<span style="color: #006600;">TOP_LEFT</span>;
init<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">loaderInfo</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//and this in the init method</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Capabilities</span>.<span style="color: #0066CC;">playerType</span> == <span style="color: #ff0000;">&quot;StandAlone&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
local = <span style="color: #000000; font-weight: bold;">true</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>I do this to test locally without having to compile the preloader every time. Also, I might need to know if I am local if I use AMF. In that case, the url for my gateway will be different.</p>
<p>For the rest, it is pretty straight forward, a MainContext for the application that will start it, a command to create the models, a command to create the mediators and finally an ApplicationModel. I don&#8217;t create the ApplicationModel in the CreateModelsCommand because I want to parse the data(parameters) inside of the LoaderInfo I passed in the constructor of the MainContext.</p>
<p>If you use this project template along with the <a title="Robotlegs file templates" href="http://www.zedia.net/files/RobotlegsTemplates.rar" target="_self">files templates</a>, you&#8217;re in for major time saving while enjoying Robotlegs!</p>
<p>Here are the files:<br />
<a title="Robotlegs Project template files" href="http://www.zedia.net/files/000 ActionScript 3 - AS3 Project with Robotlegs.rar" target="_self">000 ActionScript 3 &#8211; AS3 Project with Robotlegs.rar</a></p>
<p>So when you downloaded the files, go in <a title="FlashDevelop" href="http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page" target="_blank">FlashDevelop</a>, in the top menu select Tools and then Application Files&#8230; This will open the application files folder of FlashDevelop. Now go in the Projects Folder and add the files that you downloaded (copy the &#8220;000 ActionScript 3 &#8211; AS3 Project with Robotlegs&#8221; folder there). Now the next time you create a new project in FlashDevelop, scroll down and you will see it.</p>
<p><a href="http://www.zedia.net/wp-content/uploads/2010/02/Robotlegs22.jpg"><img class="aligncenter size-full wp-image-562" title="Robotlegs Project template" src="http://www.zedia.net/wp-content/uploads/2010/02/Robotlegs22.jpg" alt="" width="543" height="476" /></a></p>
<p>You may not agree with everything that is in those templates, then there is two things you can do. Either discuss about it in the comments or modify my project template. It is very easy to do so; I never even looked at documentation to learn how to do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2010/and-now-an-as3-project-robotlegs-project-template-for-flashdevelop/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

