<?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; PureMVC Skeleton for ActionScript projects</title>
	<atom:link href="http://www.zedia.net/tag/puremvc-skeleton-for-actionscript-projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zedia.net</link>
	<description>Flash, ActionScript, SEO and everything in between</description>
	<lastBuildDate>Wed, 21 Jul 2010 17:07:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>PureMVC Skeleton for ActionScript projects</title>
		<link>http://www.zedia.net/2009/puremvc-skeleton-for-actionscript-projects/</link>
		<comments>http://www.zedia.net/2009/puremvc-skeleton-for-actionscript-projects/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 16:08:42 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[PureMVC]]></category>
		<category><![CDATA[ActionScript projects]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PureMVC Skeleton]]></category>
		<category><![CDATA[PureMVC Skeleton for ActionScript projects]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=434</guid>
		<description><![CDATA[I had previously done a PureMVC skeleton for Flash websites and applications, meaning that you would use the Flash IDE compiler to compile your project. Lately I have been doing more and more ActionScript projects (compiled using the Flex compiler but not using the Flex framework) because it permits the separation of big FLAs into [...]]]></description>
			<content:encoded><![CDATA[<p>I had previously done a <a title="PureMVC Skeleton for Flash Applications / Websites" href="http://www.zedia.net/2009/puremvc-skeleton-for-flash-applications-websites/" target="_self">PureMVC skeleton for Flash websites and applications</a>, meaning that you would use the Flash IDE compiler to compile your project. Lately I have been doing more and more ActionScript projects (compiled using the Flex compiler but not using the Flex framework) because it permits the separation of big FLAs into smaller ones thus facilitating working in team. But I had no template/skeleton to start with until now.</p>
<p>So here it is:</p>
<p><a title="PureMVC ActionScript Project Skeleton" href="http://zedia.net/files/PureMVC_ActionScript_Project_Skeleton.rar">PureMVC ActionScript Project Skeleton</a></p>
<p>It still uses an external preloader and I added a local Boolean so that the application knows your are testing locally and not on the sever (useful when making server call). One of the major change is the inclusion of the SharedAssetLibrary. Basically this emulate having one FLA with all graphics and MovieClip, but you actually can have multiple FLAs. When you want to add something to the SharedAssetLibrary you first add it to a FLA, set it to Export for ActionScript and then compile it to the swf folder. Then you can add it in the SharedAssetLibrary using the embed statment:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">//BackgroundAsset being the name you gave it in the library</span>
&nbsp;
<span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">&quot;../../../swf/Background.swf&quot;</span>, symbol=<span style="color: #ff0000;">&quot;BackgroundAssets&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> BackgroundAssets:<span style="color: #000000; font-weight: bold;">Class</span>;</pre></div></div>

<p>Now if you want to use this in any of your views, first import SharedAssetLibrary and than you can use it like this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> BackgroundAssets:<span style="color: #000000; font-weight: bold;">Class</span> = SharedAssetsLibrary.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getAsset</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;BackgroundAssets&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> assets:<span style="color: #66cc66;">*</span> = <span style="color: #000000; font-weight: bold;">new</span> BackgroundAssets<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
addChild<span style="color: #66cc66;">&#40;</span>Sprite<span style="color: #66cc66;">&#40;</span>assets<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>I included a FlashDevelop project file in there, but you can just delete it if you use Flash Builder.</p>
<p>Using a skeleton greatly reduce the setup time of a project, so I hope this will help you. I want to look into doing a skeleton for Flex Application, because I don&#8217;t like the <a title="PureMVC Flex application skeleton" href="http://trac.puremvc.org/Demo_AS3_Flex_AppSkeleton" target="_blank">skeleton</a> that is available on the <a title="PureMVC" href="http://puremvc.org/" target="_blank">PureMVC</a> website.</p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.zedia.net%2F2009%2Fpuremvc-skeleton-for-actionscript-projects%2F&amp;layout=standard&amp;show-faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:550px; height:70px;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2009/puremvc-skeleton-for-actionscript-projects/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
