<?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>José Carlos Fiel &#187; Melhores Práticas</title>
	<atom:link href="http://blog.josecarlosfiel.com.br/tag/melhores-praticas/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.josecarlosfiel.com.br</link>
	<description></description>
	<lastBuildDate>Thu, 05 Aug 2010 21:31:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Várias técnicas de melhores práticas e otimização em ActionScript 3.0 e Flex.</title>
		<link>http://blog.josecarlosfiel.com.br/varias-tecnicas-de-melhores-praticas-e-otimizacao-em-actionscript-30-e-flex/</link>
		<comments>http://blog.josecarlosfiel.com.br/varias-tecnicas-de-melhores-praticas-e-otimizacao-em-actionscript-30-e-flex/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 05:26:53 +0000</pubDate>
		<dc:creator>José Carlos Silveira Fiel</dc:creator>
				<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Melhores Práticas]]></category>
		<category><![CDATA[Otimização]]></category>

		<guid isPermaLink="false">http://blog.fielweb.com.br/?p=48</guid>
		<description><![CDATA[ 
			
				
			
		
 Bom a pedido de muitos para que eu lançasse logo meu primeiro post foram muitas e aqui está. Gostaria de agradecer meu colega Ricardo por me enviar um belo post do Sean Moore, publicado no InsideRIA, sobre o trabalho de otimizar e descobrir melhores práticas em ActionScript 3.0 e Flex, usando o Flex]]></description>
			<content:encoded><![CDATA[<div style="float:right;margin:0px 0px 0px 0px;"><a href="http://www.google.com/reader/link?url=http://blog.josecarlosfiel.com.br/varias-tecnicas-de-melhores-praticas-e-otimizacao-em-actionscript-30-e-flex/&title=Várias técnicas de melhores práticas e otimização em ActionScript 3.0 e Flex.&srcTitle=José Carlos Fiel&srcURL=http://blog.josecarlosfiel.com.br"target="_blank" rel=""><img border="0" src="http://blog.josecarlosfiel.com.br/wp-content/plugins/wp-google-buzz/icon/9.png" style="opacity:1;filter:alpha(opacity=100)" onmouseover="this.style.opacity=0.8;this.filters.alpha.opacity=80" onmouseout="this.style.opacity=1;this.filters.alpha.opacity=100"/> </a></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.josecarlosfiel.com.br%2Fvarias-tecnicas-de-melhores-praticas-e-otimizacao-em-actionscript-30-e-flex%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.josecarlosfiel.com.br%2Fvarias-tecnicas-de-melhores-praticas-e-otimizacao-em-actionscript-30-e-flex%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;"><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:HyphenationZone>21</w:HyphenationZone> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>PT-BR</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val="&#45;-" /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Locked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--> Bom a pedido de muitos para que eu lançasse logo meu primeiro post foram muitas e aqui está. Gostaria de agradecer meu colega Ricardo por me enviar um belo <a href="http://www.insideria.com/2009/04/51-actionscript-30-and-flex-op.html" target="_blank">post do Sean Moore</a>, publicado no InsideRIA, sobre o trabalho de otimizar e descobrir melhores práticas em ActionScript 3.0 e Flex, usando o Flex Profiler. Achei bastante interessante e resolvi brevemente divulgar essas técnicas e traduzi-lás.<br />
Antes de mostrar as técnicas, gostaria de falar rapidamente sobre  a perspectiva Flex Profiler (imagem a seguir) dentro do Flex Builder 3, usada pelo Moore,  ajuda a você ter uma noção de uso de memória, consumo de cada propriedade, chamada de método e instanciação de objetos dentro de sua aplicação.</p>
<p style="text-align: center;">
<div id="attachment_55" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.fielweb.com.br/wp-content/uploads/2009/04/fx3profile1.png" target="_blank"><img class="size-medium wp-image-55" title="Perspectiva Flex Profiler" src="http://blog.fielweb.com.br/wp-content/uploads/2009/04/fx3profile1-300x285.png" alt="Imagem da perspectiva Flex Profiler" width="300" height="285" /></a><p class="wp-caption-text">Imagem da perspectiva Flex Profiler</p></div>
<p>Bom pode ter certeza que estarei dedicando um post sobre o Flex Profiler, mas por enquanto vamos ao que interessa neste post, que são as técnicas de melhores práticas e otimização.</p>
<p>Seguem elas:</p>
<p>1. Evite usar o operador <span style="color: #3366ff;"><strong>new</strong></span> quando for criar Arrays</p>
<pre class="brush: plain"> var a = [];</pre>
<p>Não use:</p>
<pre class="brush: plain"> var a = new Array ();</pre>
<p>2. Criar arrays consome muito recurso, portanto conserve-os.</p>
<pre class="brush: plain"> var vanityCollection01: Array = new Array ();
 var vanityCollection02: Array = new Array ();
 var vanityCollection03: Array = new Array ();
 var vanityCollection04: Array = new Array ();</pre>
<p>3. Maneira mais rápida de copiar um array:</p>
<pre class="brush: plain"> var copy : Array = sourceArray.concat();</pre>
<p>4. Setar valores em arrays é lento:</p>
<pre class="brush: plain"> empregados.push(trabalhador);
 empregados[2] = trabalhador;</pre>
<p>5. Resgatar valores de Arrays é duas vezes mais rápido do que setá-los:</p>
<pre class="brush: plain"> var trabalhador:Trabalhador = empregados[2];</pre>
<p>6. Use métodos estáticos quando esses não precisam de uma instancia de objeto:</p>
<pre class="brush: plain">StringUtils.trim(&quot;Texto com espaço no final &quot;);
Definição da classe:
package
{
     public final class StringUtils
     {
          public static function trim( s : String ) : String
          {
               var trimmed : String;
               // implementação...
               return trimmed;
          }
     }
}</pre>
<p>7. Use const para propriedades (constantes), caso seu valor nunca irá mudar durante todo o ciclo de sua aplicação:</p>
<pre class="brush: plain">public const APPLICATION_PUBLISHER : String = &quot;Company, Inc.&quot;;</pre>
<p>8. Use final quando a classe não pode conter herança, ou seja, não pode extende-la com outra classe.</p>
<pre class="brush: plain">public final class StringUtils</pre>
<p>9. Nomes longos para métodos/variáveis não impacta na performance em ActionScript 3.0 (mas sim em outras linguagens).</p>
<pre class="brush: plain">algunsNomesLongosLoucosDeMetodoNaoFazRealmenteUmImpactoGrandeNaPerformance();</pre>
<p>10. Uma linha atribuída NÃO compra nenhuma performance (mas sim em outras linguagens).</p>
<pre class="brush: plain">var i=0; j=10; k=200;</pre>
<p>11. Não há diferença de uso de memória entre o uso de If ou Switch:</p>
<pre class="brush: plain">if ( condition )
{
     // manipula condição
}</pre>
<p>IDENTICO USO DE MEMÓRIA:</p>
<pre class="brush: plain">switch ( condition )
{
     case &quot;A&quot;:
         // logica para manipular caso A
     break; 

     case &quot;B&quot;:
         // logica para manipular caso B
     break;
}</pre>
<p>12. Use em suas condições If, uma ordenação a qual costuma ser mais verdadeira do que as outras:</p>
<pre class="brush: plain">if ( conditionThatHappensAlot )
{
     // logica para manipular condição que é encontrada frequentemente
}
else if ( conditionThatHappensSomtimes )
{
     // manipula caso essa é encontrada ocasionalmente
}
else
{
     // manipula caso essa não é muito necessária
}</pre>
<p>13. AVM (ActionScript Virtual Machine) converte int para Number durante calculos dentro de loops (VM foi alterada, da versão 9 para 10, assim conversões de int, uint e Number não são mais lentas como costumavam ser).</p>
<p>14. Resolver problemas de conversão e de tipos de objetos incorretos.</p>
<p>15. Use uint moderadamente, ele pode ser lento (VM foi modificada, da versão 9 para 10, assim conversões de int, uint e Number não são mais lentas como costumavam ser).</p>
<pre class="brush: plain">var footerHex : uint = 0x00ccff;</pre>
<p>16. Use inteiros para interações:</p>
<pre class="brush: plain">for (var i: int = 0; i &lt; n; i++)
Não use:
for (var i: Number = 0; i &lt; n; i++)</pre>
<p>17. Não use inteiro com decimal:</p>
<pre class="brush: plain">var decimal : Number  = 14.654;</pre>
<p>Não use:</p>
<pre class="brush: plain">var decimal : int  = 14.654;</pre>
<p>18. Multiplicação x Divisão: em vez de usar 5000/1000 use: 5000*0.001</p>
<p>19. Em loops como for ou while, procure deixar expressões fora dos mesmos, para evitar que elas se repitam:</p>
<pre class="brush: plain">//errado
for (..){ a * 180 / Math.PI; }

//declare fora do loop:
toRadians = a*180/Math.PI;</pre>
<p>20. Evite calcular e usar chamadas de métodos em loops:</p>
<pre class="brush: plain">var len : int = myArray.lengh;
for (var i=0; i &lt; int; i++) { }</pre>
<p>Não use:</p>
<pre class="brush: plain">for (var i=0; i &lt; myArray.lengh;i++){ }</pre>
<p>21. Use RegEx para validação e métodos de busca de strings:</p>
<pre class="brush: plain">// validação de codigo postal usando expressão regular
private var regEx:RegExp = /^[A-Z][0-9][A-Z] [0-9][A-Z][0-9]$/i;
private function validatePostal( event : Event ) : void
{
     if( regEx.test( zipTextInput.text ) )
     {
          // manipula caso o campo é inválido
     }
} 

// busca uma palavra usando métodos String
var string : String = &quot;Search me&quot;;
var searchIndex : int = string.indexOf( &quot;me&quot; );
var search : String = string.substring( searchIndex, searchIndex + 2 );</pre>
<p>22. Reutilize objetos para manter uma memória estável, DisplayObjects e objeto URLLoader.</p>
<p>23. Seguinte modelo de componente Flex:</p>
<pre class="brush: plain">createChildren();
commitProperties();
updateDisplayList();</pre>
<p>24. Somente use DataGrids em último resurso (certifique-se se você pode montar uma List primeiro).</p>
<p>25. Evite Repeaters para rolagem de dados.</p>
<p>26. Evite o método setStyle() (Um dos métodos que mais consome recurso do framework Flex).</p>
<p>27. Usar muitos componentes, reduz drasticamente o desempenho de sua aplicação:</p>
<pre class="brush: plain">
&lt;mx:Panel&gt;
    &lt;mx:VBox&gt;
        &lt;mx:HBox&gt;
            &lt;mx:Label text=&quot;Label 1&quot; /&gt;
             &lt;mx:VBox&gt;
                  &lt;mx:Label text=&quot;Label 2&quot; /&gt;
              &lt;/mx:VBox&gt;
              &lt;mx:HBox&gt;
                  &lt;mx:Label text=&quot;Label 3&quot; /&gt;
                  &lt;mx:VBox&gt;
                      &lt;mx:Label text=&quot;Label 4&quot; /&gt;
                  &lt;/mx:VBox&gt;
              &lt;/mx:HBox&gt;
          &lt;/mx:HBox&gt;
      &lt;/mx:VBox&gt;
&lt;/mx:Panel&gt;
</pre>
<p>28. Você pode fechar a tag de um componente simplesmente usando &#8220;/&gt;&#8221;.</p>
<pre class="brush: plain">
&lt;mx:Image xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
     source=&quot;avatar.jpg&quot; width=&quot;200&quot; height=&quot;200&quot; /&gt;
</pre>
<p>29. Remova os componentes desnecessários para reduzir o aninhamento dos mesmos.</p>
<p>30. Evite: O componente VBox dentro de um Panel, sendo que ele possui a propriedade layout como vertical, horizontal ou absoluto, evitando assim uma redundancia.</p>
<pre class="brush: plain">
&lt;!-- Correto --&gt;
&lt;mx:Panel&gt;
    &lt;mx:Label text=&quot;Label 1&quot; /&gt;
    &lt;mx:Label text=&quot;Label 2&quot; /&gt;
&lt;/mx:Panel&gt; 

&lt;!-- Não Use --&gt;
&lt;mx:Panel&gt;
     &lt;mx:VBox&gt;
        &lt;mx:Label text=&quot;Label 1&quot; /&gt;
        &lt;mx:Label text=&quot;Label 2&quot; /&gt;
    &lt;/mx:VBox&gt;
&lt;/mx:Panel&gt;
</pre>
<p>31. Evite: O componente VBox dentro de um Application, sendo que ela possui a propriedade layout como vertical, horizontal ou absoluto, evitando assim uma redundancia.</p>
<pre class="brush: plain">
&lt;!-- Correto --&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=http://www.adobe.com/2006/mxml&gt;
    &lt;mx:Label text=&quot;Label 1&quot; /&gt;
    &lt;mx:Label text=&quot;Label 2&quot; /&gt;
&lt;/mx:Application&gt;

&lt;!-- Não Use --&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=http://www.adobe.com/2006/mxml&gt;
    &lt;mx:VBox&gt;
        &lt;mx:Label text=&quot;Label 1&quot; /&gt;
        &lt;mx:Label text=&quot;Label 2&quot; /&gt;
    &lt;/mx:VBox&gt;
&lt;/mx:Application&gt;
</pre>
<p>32. Setar a propriedade recycleChildren como true para melhorar a performance de objetos Repeaters.<br />
(A reutilização usada, criou filhos ao em vez de criar novos objetos).</p>
<pre class="brush: plain">
&lt;mx:Script&gt;
    &lt;![CDATA[
        [Bindable]
        public var repeaterData : Array = [&quot;data 1&quot;, &quot;data 2&quot;];
    ]]&gt;
&lt;/mx:Script&gt; 

&lt;mx:Repeater id=&quot;repeater&quot; dataProvider=&quot;{repeaterData}&quot;&gt;
    &lt;mx:Label text=&quot;data item: {repeater.currentItem}&quot;/&gt;
&lt;/mx:Repeater&gt;
</pre>
<p>33. Trave seu framerate em 60fps ou menor:</p>
<pre class="brush: plain">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=http://www.adobe.com/2006/mxml
    frameRate=&quot;45&quot;&gt;
&lt;/mx:Application&gt;
</pre>
<p>34. Evite mostrar multiplas manipulações por frame.</p>
<p>35. Use o evento ENTER_FRAME ao em vez do evento Timer:</p>
<pre class="brush: plain">public function onEnterFrame( event : Event ) : void
{
}
private function init() : void
{
     addEventListener( Event.ENTER_FRAME, onEnterFrame );
}</pre>
<p>Não use:</p>
<pre class="brush: plain">public function onTimerTick( event : Event ) : void
{
}
private function init() : void
{
     var timer : Timer = new Timer();
     timer.start();
     timer.addEventListener( TimerEvent.TIMER, onTimerTick );
}</pre>
<p>36. Para adiar a criação de um objeto para vários frames use:</p>
<pre class="brush: plain">
&lt;mx:Container creationPolicy=&quot;queued&quot;/&gt;
</pre>
<p>37. Alpha = 0 não é o mesmo que visible = false (Objetos marcados como invisivel são ignorados).</p>
<pre class="brush: plain">loginButton.visible = false;</pre>
<p>Não use:</p>
<pre class="brush: plain">loginButton.alpha = 0;</pre>
<p>Outras Referencias citadas por Sean:</p>
<p>Sean Christmann: Optimizing Adobe AIR for Code Execution, Memory, and Rendering<br />
<a href="http://www.craftymind.com/2008/11/20/max-2008-session-material/" target="_blank">http://www.craftymind.com/2008/11/20/max-2008-session-material/</a></p>
<p>Dennis Ippel: Some ActionScript 3.0 Optimizations<br />
<a href="http://www.rozengain.com/blog/2007/05/01/some-actionscript-30-optimizations/" target="_blank">http://www.rozengain.com/blog/2007/05/01/some-actionscript-30-optimizations/</a></p>
<p>Shane McCartney: Tips on how to write efficient AS3<br />
<a href="http://www.lostinactionscript.com/blog/index.php/2008/09/28/tips-on-how-to-write-efficient-as3/" target="_blank">http://www.lostinactionscript.com/blog/index.php/2008/09/28/tips-on-how-to-write-efficient-as3/</a></p>
<p>Flex Application Performance: Tips and Techniques for Improving Client Application Performance<br />
<a href="http://www.adobe.com/devnet/flex/articles/client_perf.html" target="_blank">http://www.adobe.com/devnet/flex/articles/client_perf.html</a></p>
<p>Stephen Calender: ActionScript 3.0 Benchmarking<br />
<a href="http://www.stephencalenderblog.com/?p=7" target="_blank">http://www.stephencalenderblog.com/?p=7</a></p>
<p>Grant Skinner: Types in AS3: ints not so fast, uints slow!<br />
<a href="http://www.gskinner.com/blog/archives/2006/06/types_in_as3_in.html" target="_blank">http://www.gskinner.com/blog/archives/2006/06/types_in_as3_in.html</a></p>
<p>Grant Skinner: Resource management strategies in Flash Player 9<br />
<a href="http://www.adobe.com/devnet/flashplayer/articles/resource_management.html" target="_blank">http://www.adobe.com/devnet/flashplayer/articles/resource_management.html</a></p>
<p>Gary Grossman: ActionScript 3.0 and AVM2 Performance Tuning<br />
<a href="http://www.onflex.org/ACDS/AS3TuningInsideAVM2JIT.pdf" target="_blank">http://www.onflex.org/ACDS/AS3TuningInsideAVM2JIT.pdf</a></p>
<p>Fastest way to copy an array<br />
<a href="http://agit8.turbulent.ca/bwp/2008/08/04/flash-as3-optimization-fastest-way-to-copy-an-array/" target="_blank">http://agit8.turbulent.ca/bwp/2008/08/04/flash-as3-optimization-fastest-way-to-copy-an-array/</a></p>
<p>Andre Michelle: AS3 optimations &amp; suggestions<br />
<a href="http://blog.andre-michelle.com/2005/as3-optimations-suggestions/" target="_blank">http://blog.andre-michelle.com/2005/as3-optimations-suggestions/</a></p>
<p>Package-level function closures in ActionScript<br />
<a href="http://www.ericfeminella.com/blog/2008/05/06/package-level-function-closures-in-actionscript/" target="_blank">http://www.ericfeminella.com/blog/2008/05/06/package-level-function-closures-in-actionscript/</a></p>
<p>ActionScript 3 optimization techniques<br />
<a href="http://blog.joa-ebert.com/2008/04/26/actionscript-3-optimization-techniques/" target="_blank">http://blog.joa-ebert.com/2008/04/26/actionscript-3-optimization-techniques/</a></p>
<p>AS3 Performance Tester<br />
<a href="http://businessintelligence.me/projects/performance_tester/performanceTester.html" target="_blank">http://businessintelligence.me/projects/performance_tester/performanceTester.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.josecarlosfiel.com.br/varias-tecnicas-de-melhores-praticas-e-otimizacao-em-actionscript-30-e-flex/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
