<?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>Benoit Freslon&#039;s blog  - Game Design, Flash games, ActionScript tutorials ... &#187; optimisation</title>
	<atom:link href="http://www.benoitfreslon.com/tag/optimisation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benoitfreslon.com</link>
	<description>Indie Game developer, learn Flash &#38; ActionScript with tutorials ...</description>
	<lastBuildDate>Mon, 16 Jan 2012 16:50:31 +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>Win 80% performance on Flash ActionScript 2 project</title>
		<link>http://www.benoitfreslon.com/win-80-performance-on-flash-actionscript-2-project</link>
		<comments>http://www.benoitfreslon.com/win-80-performance-on-flash-actionscript-2-project#comments</comments>
		<pubDate>Wed, 18 Mar 2009 13:17:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript3 as3]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[actionscript3]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[optimisation]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[vs]]></category>

		<guid isPermaLink="false">http://www.thisisgameplay.com/?p=90</guid>
		<description><![CDATA[(Français) If you have lot of AS 2.0 projets like me you should be happy to know that you could win 80% performance on your projets with 4 lines of ActionScript. But this tip works only on web based projets.]]></description>
			<content:encoded><![CDATA[<p>If you have lot of AS 2.0 projets like me you should be happy to know that you could win 80% performance on your projets with 4 lines of ActionScript.</p>
<h3>First compile your AS 2.0 project with Flash.</h3>
<p>Export your swf file in AS 2.0. (eg: your_as2_project.swf)</p>
<h3>Then create <strong>an AS 3.0 loader</strong> with Flash CS3 or better.</h3>
<p>Keep the <strong>same framerate </strong>on your loader. The <strong>same dimentions</strong> and the <strong>same background color</strong>. Put those lines into your AS 3.0 loader and replace the swf file with your file name.</p>
<div class="codecolorer-container actionscript3 default .codecolorer" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6699cc; font-weight: bold;">var</span> request<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">URLRequest</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;your_as2_project.swf&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loader</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Loader</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Loader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #004993;">loader</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span>request<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">loader</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div></td></tr></tbody></table></div>
<h3>Finally compile your AS 3 loader.</h3>
<p>It&#8217;s magic it works perfectly. It&#8217;s more smoothly and more faster. Thanks AVM2 ;).</p>
<h3>Very important notes :</h3>
<ul>
<li><strong>Delete all your TextField variables on you AS 2.0 file</strong> and use instance name. In AS 3.0 AVM2 doesn&#8217;t support TextField variables.</li>
<li><strong>You couldn&#8217;t send HTML parameters to swf</strong> direclty to your AS 2.0 swf. You have to use a LocalConnection in order to send and receive informations between your 2 swf.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benoitfreslon.com/win-80-performance-on-flash-actionscript-2-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

