<?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>RichMedia+ &#187; Techniques Optimization</title>
	<atom:link href="http://blog.richmediaplus.com/category/techniques-optimization/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.richmediaplus.com</link>
	<description>About the Adobe&#039;s RIA related solution and technology, like Adobe Air, Adobe Flex, Mobile Dev. You also can find the SEO for Flex, RIA, User Ex in this blog.</description>
	<lastBuildDate>Fri, 16 Dec 2011 09:33:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Flex / Flash 性能优化之 数据存取格式</title>
		<link>http://blog.richmediaplus.com/2010/12/flex-flash-value-type/</link>
		<comments>http://blog.richmediaplus.com/2010/12/flex-flash-value-type/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 14:27:47 +0000</pubDate>
		<dc:creator>Alvin / Aedis.Ju</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Techniques Optimization]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Adobe Flex]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=705</guid>
		<description><![CDATA[以下结论由寂寞火山得出，我只是借花献佛 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- 通常我们存取数据有如下几种方式：Array, Object, 自定义类, 比较特殊的还有 Point, Rectangle 等。 效率依次为(后面的数字是100万次存取运算平均所需时间)： 自定义类public属性 135 Point 140 Rectangle(x等属性) 140 Array 270 Object 500 自定义动态类动态属性 550 Rectangle(left等属性) 700 自定义类getter/setter 1000 自定义类Function 1000 出乎意料，最快的是自定类的public属性，速度是Array的两倍Object的四倍getter/setter的八倍——很整的倍数关系。另外存取坐标要用Point和Rectangle，比Array快的多。Object还是少用吧，多用自定义类。 另外自定义密封类(sealed,默认)和自定义动态类(dynamic)的public属性、getter/setter速度几乎一样，而动态类动态添加的属性和Object相若。 Related posts: Flex / Flash 性能优化技巧之 function SEO For Flex/Flash Flex 3 Style Module
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2010/12/flex-flash-function/' rel='bookmark' title='Flex / Flash 性能优化技巧之 function'>Flex / Flash 性能优化技巧之 function</a></li>
<li><a href='http://blog.richmediaplus.com/2009/07/seo-for-flex-flash/' rel='bookmark' title='SEO For Flex/Flash'>SEO For Flex/Flash</a></li>
<li><a href='http://blog.richmediaplus.com/2011/05/flex-3-style-module/' rel='bookmark' title='Flex 3 Style Module'>Flex 3 Style Module</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>以下结论由<strong>寂寞火山</strong>得出，我只是借花献佛<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
通常我们存取数据有如下几种方式：Array, Object, 自定义类, 比较特殊的还有 Point, Rectangle 等。<br />
效率依次为(后面的数字是100万次存取运算平均所需时间)：</p>
<p>自定义类public属性 135<br />
Point 140<br />
Rectangle(x等属性) 140<br />
Array 270<br />
Object 500<br />
自定义动态类动态属性 550<br />
Rectangle(left等属性) 700<br />
自定义类getter/setter 1000<br />
自定义类Function 1000</p>
<p>出乎意料，最快的是自定类的public属性，速度是Array的两倍Object的四倍getter/setter的八倍——很整的倍数关系。另外存取坐标要用Point和Rectangle，比Array快的多。Object还是少用吧，多用自定义类。<br />
另外自定义密封类(sealed,默认)和自定义动态类(dynamic)的public属性、getter/setter速度几乎一样，而动态类动态添加的属性和Object相若。</p>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2010/12/flex-flash-function/' rel='bookmark' title='Flex / Flash 性能优化技巧之 function'>Flex / Flash 性能优化技巧之 function</a></li>
<li><a href='http://blog.richmediaplus.com/2009/07/seo-for-flex-flash/' rel='bookmark' title='SEO For Flex/Flash'>SEO For Flex/Flash</a></li>
<li><a href='http://blog.richmediaplus.com/2011/05/flex-3-style-module/' rel='bookmark' title='Flex 3 Style Module'>Flex 3 Style Module</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2010/12/flex-flash-value-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex / Flash 性能优化技巧之 function</title>
		<link>http://blog.richmediaplus.com/2010/12/flex-flash-function/</link>
		<comments>http://blog.richmediaplus.com/2010/12/flex-flash-function/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 14:18:59 +0000</pubDate>
		<dc:creator>Alvin / Aedis.Ju</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Techniques Optimization]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=706</guid>
		<description><![CDATA[还记得Flex/Flash的程式优化里面有指明flash自带的Math类本身就是AS实现的，所以处理速度很慢。 比如 abs(value:Number) 可以用 value &#60; 0 ? -value : value 这样来代替。 也正是因为这样，我就想自己写个Math类MathUtil来取代Math里面的如abs(value:Number)这样的方法。 MathUtil.as public static function abs&#40;value:Number&#41;:Number &#123; return value &#60; 0 ? -value : value; &#125; 但是测试下来发现自己的MathUtil类比原来的Math类速度慢了一倍之多，难道Math.abs在fp10里优化了？ 结果如果直接采用value &#60; 0 ? -value : value来取代MathUtil.abs(value:Number)的代码，速度就比Math.abs(value:Number)快得多。 因此结论得出是function的关系，如果code代码执行重新套用了一层function，那么运行的速度结果是慢得多。 所以这也说明在对性能及其严格的情况下，写代码的时候也尽量降低代码的层次嵌套关系。 Related posts: htmlFormat for Reduce DataBase Storage in Client Flex / Flash 性能优化之 数据存取格式 AS3 Static Function [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/03/htmlformatforreducedatabasestorageinclient/' rel='bookmark' title='htmlFormat for Reduce DataBase Storage in Client'>htmlFormat for Reduce DataBase Storage in Client</a></li>
<li><a href='http://blog.richmediaplus.com/2010/12/flex-flash-value-type/' rel='bookmark' title='Flex / Flash 性能优化之 数据存取格式'>Flex / Flash 性能优化之 数据存取格式</a></li>
<li><a href='http://blog.richmediaplus.com/2011/07/as3-static-function-variable/' rel='bookmark' title='AS3 Static Function Variable'>AS3 Static Function Variable</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>还记得Flex/Flash的程式优化里面有指明flash自带的Math类本身就是AS实现的，所以处理速度很慢。<br />
比如<br />
abs(value:Number)<br />
可以用<br />
value &lt; 0 ? -value : value<br />
这样来代替。<br />
也正是因为这样，我就想自己写个Math类MathUtil来取代Math里面的如abs(value:Number)这样的方法。</p>
<p>MathUtil.as</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">abs</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #004993;">value</span> <span style="color: #000066; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000066; font-weight: bold;">?</span> <span style="color: #000066; font-weight: bold;">-</span><span style="color: #004993;">value</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>但是测试下来发现自己的MathUtil类比原来的Math类速度慢了一倍之多，难道Math.abs在fp10里优化了？<br />
结果如果直接采用value &lt; 0 ? -value : value来取代MathUtil.abs(value:Number)的代码，速度就比Math.abs(value:Number)快得多。</p>
<p>因此结论得出是function的关系，如果code代码执行重新套用了一层function，那么运行的速度结果是慢得多。<br />
所以这也说明在对性能及其严格的情况下，写代码的时候也尽量降低代码的层次嵌套关系。</p>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/03/htmlformatforreducedatabasestorageinclient/' rel='bookmark' title='htmlFormat for Reduce DataBase Storage in Client'>htmlFormat for Reduce DataBase Storage in Client</a></li>
<li><a href='http://blog.richmediaplus.com/2010/12/flex-flash-value-type/' rel='bookmark' title='Flex / Flash 性能优化之 数据存取格式'>Flex / Flash 性能优化之 数据存取格式</a></li>
<li><a href='http://blog.richmediaplus.com/2011/07/as3-static-function-variable/' rel='bookmark' title='AS3 Static Function Variable'>AS3 Static Function Variable</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2010/12/flex-flash-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AlertUtil ppt 在 slideshare</title>
		<link>http://blog.richmediaplus.com/2010/07/alertutil-ppt/</link>
		<comments>http://blog.richmediaplus.com/2010/07/alertutil-ppt/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 15:19:03 +0000</pubDate>
		<dc:creator>Alvin / Aedis.Ju</dc:creator>
				<category><![CDATA[ActionScript Library]]></category>
		<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[richmediaplus Lab]]></category>
		<category><![CDATA[Techniques Optimization]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[ppt]]></category>
		<category><![CDATA[richmediaplus.utils.AlertUtil]]></category>
		<category><![CDATA[slideshare]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=672</guid>
		<description><![CDATA[分享在 天地会 RIA天地行演讲的ppt。 Alert util View more presentations from Aedis Ju. Related posts: AlertUtils 更名为 AlertUtil richmediaplus.utils.AlertUtils htmlFormat for Reduce DataBase Storage in Client
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2010/07/alertutils-alertutil/' rel='bookmark' title='AlertUtils 更名为 AlertUtil'>AlertUtils 更名为 AlertUtil</a></li>
<li><a href='http://blog.richmediaplus.com/2010/07/richmediaplus-utils-alertutils/' rel='bookmark' title='richmediaplus.utils.AlertUtils'>richmediaplus.utils.AlertUtils</a></li>
<li><a href='http://blog.richmediaplus.com/2009/03/htmlformatforreducedatabasestorageinclient/' rel='bookmark' title='htmlFormat for Reduce DataBase Storage in Client'>htmlFormat for Reduce DataBase Storage in Client</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>分享在 天地会 RIA天地行演讲的ppt。</p>
<div style="width:425px" id="__ss_4878458"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/aedisju/alert-util" title="Alert util">Alert util</a></strong><object id="__sse4878458" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=alertutil-100731101021-phpapp02&#038;stripped_title=alert-util" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4878458" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=alertutil-100731101021-phpapp02&#038;stripped_title=alert-util" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/aedisju">Aedis Ju</a>.</div>
</div>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2010/07/alertutils-alertutil/' rel='bookmark' title='AlertUtils 更名为 AlertUtil'>AlertUtils 更名为 AlertUtil</a></li>
<li><a href='http://blog.richmediaplus.com/2010/07/richmediaplus-utils-alertutils/' rel='bookmark' title='richmediaplus.utils.AlertUtils'>richmediaplus.utils.AlertUtils</a></li>
<li><a href='http://blog.richmediaplus.com/2009/03/htmlformatforreducedatabasestorageinclient/' rel='bookmark' title='htmlFormat for Reduce DataBase Storage in Client'>htmlFormat for Reduce DataBase Storage in Client</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2010/07/alertutil-ppt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10個 Adobe Flex 程式效能優化技巧</title>
		<link>http://blog.richmediaplus.com/2009/09/10-tips-for-flex-application-performance/</link>
		<comments>http://blog.richmediaplus.com/2009/09/10-tips-for-flex-application-performance/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 05:25:27 +0000</pubDate>
		<dc:creator>Alvin / Aedis.Ju</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Techniques Optimization]]></category>
		<category><![CDATA[Adobe Flex]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=343</guid>
		<description><![CDATA[關于程式效能優化的文章，我前面介紹過2篇，都是值得一看： Adobe Air程式效能優化技巧 ActionScript and Flex optimization techniques and practices recommendation 近日在 InsideRIA 發表了新的一篇 10 Tips for Flex Application Performance ，是我非常敬仰的大師 Andrew Trice 所寫，程式效能優化雖然老生常談，但畢竟大師的作品是不應該落下的，因此拉出來跟大家一起品味一下。 原文就自己看了，我稍微用中文總結一下 Andrew Trice 所述的其中 6 點。 Manage your event listeners 要經常 remove 不需要的 event listeners。 定義 event listeners 的時候，注意 target 和 parent 的關系。 設置好 Event 的 bubbles &#38; cancelable。 addEventListener 中的 [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/07/seo-for-flex-flash/' rel='bookmark' title='SEO For Flex/Flash'>SEO For Flex/Flash</a></li>
<li><a href='http://blog.richmediaplus.com/2009/04/why-we-need-talk-about-the-seo-for-flex/' rel='bookmark' title='Why we need talk about the SEO for Flex/Flash?'>Why we need talk about the SEO for Flex/Flash?</a></li>
<li><a href='http://blog.richmediaplus.com/2009/06/keywords-about-the-adobe-flex-flash-in-2009/' rel='bookmark' title='2009 Adobe Flash / Adobe Flex 重點留意關鍵字'>2009 Adobe Flash / Adobe Flex 重點留意關鍵字</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>關于程式效能優化的文章，我前面介紹過2篇，都是值得一看：</p>
<ul>
<li><a title="Permanent Link to Adobe Air程式效能優化技巧" rel="bookmark" href="../2009/05/performance_tips_for_adobe_air/" target="_blank">Adobe Air程式效能優化技巧</a></li>
<li><a title="Permanent Link to ActionScript and Flex optimization techniques and practices recommendation" rel="bookmark" href="../2009/04/actionscript-and-flex-optimization-techniques-and-practices-recommendation/" target="_blank">ActionScript and Flex optimization techniques and practices recommendation</a></li>
</ul>
<p>近日在 InsideRIA 發表了新的一篇 <a href="http://www.insideria.com/2009/09/10-tips-for-flex-application-p.html" target="_blank">10 Tips for Flex Application Performance</a> ，是我非常敬仰的大師 Andrew Trice 所寫，程式效能優化雖然老生常談，但畢竟大師的作品是不應該落下的，因此拉出來跟大家一起品味一下。</p>
<p>原文就自己看了，我稍微用中文總結一下 Andrew Trice 所述的其中 6 點。</p>
<ul>
<li> Manage your event listeners<br />
要經常 remove 不需要的 event listeners。<br />
定義 event listeners 的時候，注意 target 和 parent 的關系。<br />
設置好 Event 的 bubbles &amp; cancelable。<br />
addEventListener 中的 useCapture， priority， useWeakReference。</li>
<li> Unload loaders<br />
如果使用的 Component 是基于 loader 的，諸如 SWFLoader， Image等等，要使用 unloadAndStop()。<br />
unloadAndStop()，這個是 flashplayer 10 后才有的，flashplayer 9 的 unload()并不能真正回收，應該也屬于 bug 的范疇。<br />
關于 unloadAndStop() ，大家可以參考下面的2篇文章作大致的了解：<br />
	<a href="http://ticore.blogspot.com/2009/05/flash-player-10-unloadandstop-test.html" target="_blank">Flash  Player 10 unloadAndStop 測試</a><br />
	<a href="http://www.830308.com/blog/article.asp?id=363" target="_blank">FlashPlayer10的Loader.unloadAndStop</a>
</li>
<li> Dispose of things<br />
在做 dispose() 的時候，把一切該混滅得都毀滅吧。</li>
<li> Handle collections properly<br />
去了解 ICollectionView 的 enableAutoUpdate () &amp; disableAutoUpdate () ，這一點對寫 Component 的同學特別重要。<br />
如果沒有使用 data binding，盡量使用 Array。<br />
在 sort &amp; filterFunction 后是否立即要使用 refresh() 需要注意畫面的實際情況。</li>
<li> Use deferred instantiation<br />
這一點需要大家去了解 Flex Component 的 lifeCycle 。<br />
在使用tab，nav， accordion， viewstack等控件的時候，Flex 用 creationPolicy 來進行對子對象創建的策略。默認情況下，tab，nav， accordion， viewstack等的子控件都沒有完全生成，而是在比如點擊第二頁的時候，他會去生成第二個子控件里面的內容。<br />
因此，對 Flex Component 而言，不要把生成子對象寫在 Constructor 里面，要記得去 override createChildren()。</li>
<li> Object recycling vs new objects<br />
Reduce，  Reuse，  Recycle 就是最大的概況。</li>
<li> Don&#8217;t invalidate/destroy/re-validate your objects if nothing changed</li>
<li> Dynamic/Generic vs. Typed Objects</li>
<li> Use constants when applicable</li>
<li> Use static members</li>
</ul>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/07/seo-for-flex-flash/' rel='bookmark' title='SEO For Flex/Flash'>SEO For Flex/Flash</a></li>
<li><a href='http://blog.richmediaplus.com/2009/04/why-we-need-talk-about-the-seo-for-flex/' rel='bookmark' title='Why we need talk about the SEO for Flex/Flash?'>Why we need talk about the SEO for Flex/Flash?</a></li>
<li><a href='http://blog.richmediaplus.com/2009/06/keywords-about-the-adobe-flex-flash-in-2009/' rel='bookmark' title='2009 Adobe Flash / Adobe Flex 重點留意關鍵字'>2009 Adobe Flash / Adobe Flex 重點留意關鍵字</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2009/09/10-tips-for-flex-application-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SEO For Flex/Flash</title>
		<link>http://blog.richmediaplus.com/2009/07/seo-for-flex-flash/</link>
		<comments>http://blog.richmediaplus.com/2009/07/seo-for-flex-flash/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 12:51:14 +0000</pubDate>
		<dc:creator>Alvin / Aedis.Ju</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[richmediaplus Lab]]></category>
		<category><![CDATA[SEO for Flex]]></category>
		<category><![CDATA[Techniques Optimization]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[SEO for Flash]]></category>
		<category><![CDATA[SWFAddress]]></category>
		<category><![CDATA[SWFObject]]></category>
		<category><![CDATA[URLKit]]></category>
		<category><![CDATA[Virtual Unique URLs]]></category>
		<category><![CDATA[XMP]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=298</guid>
		<description><![CDATA[今天算是完整得讀完了 SEO For Flash 這本書，雖然該書是第一本關于怎么SEO Flash方面的書籍，但內容方面并沒有讓我有很多的驚喜，還是我所知道的內容和方法，只是它作了一個比較好的總結，難免有些失望啊。下面就結合自己的經驗，重新整理一下對 Flex/Flash SEO 的方法。 替换内容（Alternative Content） html 中嵌入 swf 的 object 元素允許替換內容 （Alternative Content） 嵌套在其中，當用戶沒有安裝 Flashplayer 的時候，這些替換內容將顯示反饋信息給用戶。這些替換內容 （Alternative Content） 能被搜索引擎很好的識別，這使它成為一個對搜索引擎友好的網頁內容的好方法。無論是從用戶體驗出發，還是從 SEO 出發，務必應該在 swf 的嵌套中使用替換內容 （Alternative Content）。 XMP metadata in Flash CS4 Flash CS4 引進 XMP metadata 。 XMP （eXtensible Metadata Platform） 是一種以標準為依據的開放式技術， 可以擷取、保留和交換數位媒體與工作流程所用的 Metadata  (指說明檔案的資訊)。XMP Metadata 存放了關于文件的各種訊息，用 Flash CS4 以上版本開發的 [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/07/virtual-unique-urls-for-flex-flash/' rel='bookmark' title='Virtual Unique URLs for Flex/Flash'>Virtual Unique URLs for Flex/Flash</a></li>
<li><a href='http://blog.richmediaplus.com/2009/04/why-we-need-talk-about-the-seo-for-flex/' rel='bookmark' title='Why we need talk about the SEO for Flex/Flash?'>Why we need talk about the SEO for Flex/Flash?</a></li>
<li><a href='http://blog.richmediaplus.com/2010/11/flash-seo-tool-makes-your-flash-site-seo-friendly/' rel='bookmark' title='Flash SEO Tool makes your flash site SEO friendly'>Flash SEO Tool makes your flash site SEO friendly</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>今天算是完整得讀完了 <a href="http://blog.richmediaplus.com/2009/04/books-from-amazon-arrived/">SEO For Flash</a> 這本書，雖然該書是第一本關于怎么SEO Flash方面的書籍，但內容方面并沒有讓我有很多的驚喜，還是我所知道的內容和方法，只是它作了一個比較好的總結，難免有些失望啊。下面就結合自己的經驗，重新整理一下對 Flex/Flash SEO 的方法。</p>
<ul>
<li><strong>替换内容（Alternative Content）</strong><br />
html 中嵌入 swf 的 object 元素允許替換內容 （Alternative Content） 嵌套在其中，當用戶沒有安裝 Flashplayer 的時候，這些替換內容將顯示反饋信息給用戶。這些替換內容 （Alternative Content） 能被搜索引擎很好的識別，這使它成為一個對搜索引擎友好的網頁內容的好方法。無論是從用戶體驗出發，還是從 SEO 出發，務必應該在 swf 的嵌套中使用替換內容 （Alternative Content）。</li>
<li><strong><a href="http://code.google.com/p/swfobject/">XMP metadata</a> in Flash CS4</strong><br />
Flash CS4 引進 XMP metadata 。 XMP （eXtensible Metadata Platform） 是一種以標準為依據的開放式技術， 可以擷取、保留和交換數位媒體與工作流程所用的 Metadata  (指說明檔案的資訊)。XMP Metadata 存放了關于文件的各種訊息，用 Flash CS4 以上版本開發的 Flash ，務必加上 XMP Metadata。</li>
<li><strong><a href="http://code.google.com/p/swfobject/">SWFObject</a></strong><br />
SWFObject 是一種利用加載 javascript 文件來嵌入 Flash 對象的一種方法，會最终替代 <a href="http://www.adobe.com/products/flashplayer/download/detection_kit/">Adobe Flash Player Detection Kit</a> 。SWFObject 易于使用，是最被推薦使用的一種方式，它解決了很多在不同瀏覽器中產生的 Bug，也很容易編寫<em>替换内容 （Alternative Content）</em>，對搜索引擎進行友好。<br />
Adobe Flex4 也已經采用了 SWFObject 的方式來顯示swf。</li>
<li><strong><a href="http://www.asual.com/swfaddress/">SWFAddress</a></strong><br />
SWFAddress 是 Flex/Flash 的 SEO 利器，通過 SWFAddress 可以對 Flex/Flash的 state 進行隨心所欲的 deepLinking 設置 （seo.html#/xxx/），而這些虛擬化的 deepLinking 是可以被搜索引擎爬蟲爬到。<br />
這里其中要特別注意的是，在設置 deepLinking 的 value 時候，盡可能對搜索引擎友好，比如設置 #/apple/ 來表示 apple 的分類，而不是采用 #/uid=xxx 的方式。</li>
<li><strong>History Manager for Flex</strong><br />
顧名思義，歷史記錄管理。Flex 對 Accordion 和 TabNavigator 還有 Viewstack（默認關閉） 容器啟用 History Manager ，這就意味著可以直接使用瀏覽器的“前進”和“后退”來使用這個功能。推薦直接使用 SWFAddress 。</li>
<li><strong><a href="http://code.google.com/p/urlkit/">URLKit</a> &amp; BrowseManager for Flex</strong><br />
Flex3 內置了一部分的 deepLinking 的功能，這就是 BrowseManager，而這些內容來源于 URLKit。URLKit 只適用于 Flex。還是推薦 SWFAddress，因為相比個人認為 SWFAddress 比較易用。</li>
<li><strong>SWF Loading Optimization for <a href="http://blog.richmediaplus.com/2009/07/virtual-unique-urls-for-flex-flash">Virtual Unique URLs</a></strong><br />
這部分是針對 Virtual Unique URLs ，在 Loading swf 的時候，因為 <a href="http://blog.richmediaplus.com/2009/07/virtual-unique-urls-for-flex-flash">Virtual Unique URLs</a> 擁有不同的子域名，所以在指向 swf 源 和其他資源的時候，應該采用讀取統一源地址的方式。<br />
詳情請看 <a href="http://blog.richmediaplus.com/2009/07/virtual-unique-urls-for-flex-flash">Virtual Unique URLs</a> 。</li>
</ul>
<p>結合實際的經驗，在實作 SEO for Flex/Flash 的時候，應該從用戶體驗和 SEO 出發，推薦采取 <a href="http://blog.richmediaplus.com/2009/07/virtual-unique-urls-for-flex-flash">Virtual Unique URLs</a> + <a href="http://code.google.com/p/swfobject/">SWFObject</a> 的方式和用戶進行交互，達到滿意的效果。</p>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/07/virtual-unique-urls-for-flex-flash/' rel='bookmark' title='Virtual Unique URLs for Flex/Flash'>Virtual Unique URLs for Flex/Flash</a></li>
<li><a href='http://blog.richmediaplus.com/2009/04/why-we-need-talk-about-the-seo-for-flex/' rel='bookmark' title='Why we need talk about the SEO for Flex/Flash?'>Why we need talk about the SEO for Flex/Flash?</a></li>
<li><a href='http://blog.richmediaplus.com/2010/11/flash-seo-tool-makes-your-flash-site-seo-friendly/' rel='bookmark' title='Flash SEO Tool makes your flash site SEO friendly'>Flash SEO Tool makes your flash site SEO friendly</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2009/07/seo-for-flex-flash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Virtual Unique URLs for Flex/Flash</title>
		<link>http://blog.richmediaplus.com/2009/07/virtual-unique-urls-for-flex-flash/</link>
		<comments>http://blog.richmediaplus.com/2009/07/virtual-unique-urls-for-flex-flash/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 12:50:56 +0000</pubDate>
		<dc:creator>Alvin / Aedis.Ju</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[richmediaplus Lab]]></category>
		<category><![CDATA[SEO for Flex]]></category>
		<category><![CDATA[Techniques Optimization]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[SWFAddress]]></category>
		<category><![CDATA[Virtual Unique URLs]]></category>
		<category><![CDATA[泛域名解析]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=302</guid>
		<description><![CDATA[SWFAddress 雖然已經給予了 Flex/Flash 網站一部分 SEO 的優勢，但是它還是有局限性。 SWFAddress 的 deepLinking，都是帶有 # 號的。假設 A 和 B 都登陸 richmediaplus.com，那么，他們的 deepLinking 分別為 richmediaplus.com/index.htm#/a/ 和richmediaplus.com/index.htm#/b/ ，這樣的URL，特別是#的存在，無論對用戶還是網站的 SEO 來說，都不是很友好。DeepLinking 最理想的方式應該是 a.richmediaplus.com 或者 richmediaplus.com/b 這樣的URL方式。 結合泛域名解析，能解決我們所碰到的尷尬問題。泛域名解析指的是通過利用通配符 * (星號) 以實現所有的次級域名指向同一個地址。以上面的例子來說，我們可以利用泛域名解析將 a.richmediaplus.com 和 b.richmediaplus.com 同時指向 all.richmediaplus.com ，在實際的服務器目錄當中，大部分的內容只存在 all.richmediaplus.com 的目錄，URLs 地址是真實存在，但是服務器中并沒有真實的目錄。all.richmediaplus.com 中的文件會 parse 當前的 Virtual Unique URLs ，結合數據訪問 Server 端 告知是 a 用戶 還是 b [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/07/seo-for-flex-flash/' rel='bookmark' title='SEO For Flex/Flash'>SEO For Flex/Flash</a></li>
<li><a href='http://blog.richmediaplus.com/2010/11/flash-seo-tool-makes-your-flash-site-seo-friendly/' rel='bookmark' title='Flash SEO Tool makes your flash site SEO friendly'>Flash SEO Tool makes your flash site SEO friendly</a></li>
<li><a href='http://blog.richmediaplus.com/2010/03/compare-with-change-adobe-flex-sound-speed-method/' rel='bookmark' title='Adobe Flex 改變聲音速度例子2則比較'>Adobe Flex 改變聲音速度例子2則比較</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>SWFAddress 雖然已經給予了 Flex/Flash 網站一部分 SEO 的優勢，但是它還是有局限性。</p>
<p>SWFAddress 的 deepLinking，都是帶有 <strong><span style="color: #ff0000;">#</span></strong> 號的。假設 A 和 B 都登陸 richmediaplus.com，那么，他們的 deepLinking 分別為 richmediaplus.com/index.htm<strong><span style="color: #ff0000;">#/a/</span></strong> 和richmediaplus.com/index.htm<strong><span style="color: #ff0000;">#/b/</span></strong> ，這樣的URL，特別是<span style="color: #ff0000;"><strong>#</strong></span>的存在，無論對用戶還是網站的 SEO 來說，都不是很友好。DeepLinking 最理想的方式應該是 a.richmediaplus.com 或者 richmediaplus.com/b 這樣的URL方式。</p>
<p>結合泛域名解析，能解決我們所碰到的尷尬問題。泛域名解析指的是通過利用通配符<strong> <span style="color: #ff0000;">* (星號) </span></strong>以實現所有的次級域名指向同一個地址。以上面的例子來說，我們可以利用泛域名解析將<strong> <span style="color: #ff0000;">a.</span></strong>richmediaplus.com 和 <strong><span style="color: #ff0000;">b.</span></strong>richmediaplus.com 同時指向 <span style="color: #ff0000;"><strong>all.</strong></span>richmediaplus.com ，在實際的服務器目錄當中，大部分的內容只存在 <span style="color: #ff0000;"><strong>all.</strong></span>richmediaplus.com 的目錄，URLs 地址是真實存在，但是服務器中并沒有真實的目錄。<span style="color: #ff0000;"><strong>all.</strong></span>richmediaplus.com 中的文件會 parse 當前的 <a href="http://blog.richmediaplus.com/2009/07/virtual-unique-urls-for-flex-flash/">Virtual Unique URLs</a> ，結合數據訪問 Server 端 告知是 <span style="color: #ff0000;"><em>a 用戶</em></span> 還是 <span style="color: #ff0000;"><em>b 用戶</em></span>，讀取限定的資料出來反饋給 Flex/Flash 進行內容的顯示，因此 a.richmediaplus.com 和 b.richmediaplus.com 讀取的文件是一樣的只是顯示的內容會根據用戶有所不同。</p>
<p>既然有了泛域名解析，那么 SWFAddress 是否就可以不用了呢？答案是否定的。<br />
假設 A 有 apple，沒有 banana ，B 有 banana 沒有 apple。那么需要存在 a.richmediaplus.com/apple 和 b.richmediaplus.com/banana 這樣的 URLs， 而 a.richmediaplus.com/banana 和 b.richmediaplus.com/apple 是不允許存在的，結合上述的泛域名解析，它們指向的是同一地址 all.richmediaplus.com，因此也同樣遇到了尷尬的問題。也正是因為 swf 的格式再結合自身對搜索引擎不友好的關系，注定還是需要 SWFAddress 這樣的工具輔助。結合 SWFAddress 的使用，上述的例子就可以變成了<span style="color: #ff0000;"> <strong>a.</strong></span>richmediaplus.com/index.htm<span style="color: #ff0000;"><strong>/#/apple/</strong></span> 和<strong> <span style="color: #ff0000;">b.</span></strong>richmediaplus.com/index.htm<span style="color: #ff0000;"><strong>/#/banana/</strong></span> 。這樣的 URL 是對搜索引擎友好的，搜索引擎可以很簡單的分析出 a 家有 apple， b 家有 banana。</p>
<p>可以看看下面的流程圖。<br />
<a title="Flickr 上 richmediaplus 的 Virtual-Unique-URLs" href="http://www.flickr.com/photos/richmediaplus/3719628523/"><img src="http://farm3.static.flickr.com/2662/3719628523_033067b2a0.jpg" alt="Virtual-Unique-URLs" width="500" height="309" /></a></p>
<p><strong>泛域名解析</strong> + <strong>SWFAddress</strong> ，我把它稱為 <strong><a href="http://blog.richmediaplus.com/2009/07/virtual-unique-urls-for-flex-flash/">Virtual Unique URLs</a></strong>。</p>
<h2><span style="color: #ff0000;"><strong>特別注意</strong></span>：</h2>
<p>在默認情況下，Developer 一般會把 main.swf 直接嵌入在 all.richmediaplus.com 下的 index.htm 頁面中， a/b/c.richmediaplus.com 指向的都是 all.richmediaplus.com ,那么在用戶在跳轉 a/b/c 的時候，他們loading的是同一個 main.swf，可是因為泛域名解析的關系，實際下載的 main.swf 分別要下3次，即分別為 a.richmdiaplus.com/main.swf b.richmdiaplus.com/main.swf c.richmdiaplus.com/main.swf，所以在編寫 index.htm 的時候，記得要把 loading 的 swf 改寫指向為同一URL絕對地址。如 value = “main.swf” 改寫為 <strong><span style="color: #ff0000;">value = “http://all.richmediaplus.com/main.swf”</span></strong> ，這樣無論用戶跳轉到哪個地址，swf 都指向 http://all.richmediaplus.com/main.swf ，因此用戶只需 loading swf 一次就夠了。</p>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/07/seo-for-flex-flash/' rel='bookmark' title='SEO For Flex/Flash'>SEO For Flex/Flash</a></li>
<li><a href='http://blog.richmediaplus.com/2010/11/flash-seo-tool-makes-your-flash-site-seo-friendly/' rel='bookmark' title='Flash SEO Tool makes your flash site SEO friendly'>Flash SEO Tool makes your flash site SEO friendly</a></li>
<li><a href='http://blog.richmediaplus.com/2010/03/compare-with-change-adobe-flex-sound-speed-method/' rel='bookmark' title='Adobe Flex 改變聲音速度例子2則比較'>Adobe Flex 改變聲音速度例子2則比較</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2009/07/virtual-unique-urls-for-flex-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Air程式效能優化技巧</title>
		<link>http://blog.richmediaplus.com/2009/05/performance_tips_for_adobe_air/</link>
		<comments>http://blog.richmediaplus.com/2009/05/performance_tips_for_adobe_air/#comments</comments>
		<pubDate>Fri, 08 May 2009 05:14:45 +0000</pubDate>
		<dc:creator>Alvin / Aedis.Ju</dc:creator>
				<category><![CDATA[Air]]></category>
		<category><![CDATA[Techniques Optimization]]></category>
		<category><![CDATA[Adobe Air]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=225</guid>
		<description><![CDATA[上次提到過ActionScript and Flex optimization techniques and practices recommendation，這次Adobe Air Team Blog發布了Performance Tips for Adobe AIR 。 總得來說有幾點可以參考： 盡可能得減少 mx:WindowedApplication:frameRate。frameRate為Air的影格速率，比如Air默認的frameRate是24，那么它說明Air的影格一秒鐘要刷24次，相當于每41ms刷一次。Arno Gourdol推薦frameRate=7開始調校。 當Air程式APPLICATION_DEACTIVATE的時候，設定frameRate=1，減少CPU消耗。 盡可能得使用Timer而不是enterFrame進行相關的程式操作。enterFrame耗費相當大的資源。 如果是基于Adobe Flex的Air，使用profile觀察減少資源消耗。Flex的話，還是先從ActionScript and Flex optimization techniques and practices recommendation做起吧。 更多參考： Writing well-behaved, efficient, AIR applications by Arno Gourdo Idle CPU Usage in Adobe AIR and Flash Player on the Mac by Grant Skinne [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/04/actionscript-and-flex-optimization-techniques-and-practices-recommendation/' rel='bookmark' title='ActionScript and Flex optimization techniques and practices recommendation'>ActionScript and Flex optimization techniques and practices recommendation</a></li>
<li><a href='http://blog.richmediaplus.com/2009/09/10-tips-for-flex-application-performance/' rel='bookmark' title='10個 Adobe Flex 程式效能優化技巧'>10個 Adobe Flex 程式效能優化技巧</a></li>
<li><a href='http://blog.richmediaplus.com/2009/04/adobe-air-developer-toolbox-resources-and-tutorials/' rel='bookmark' title='Adobe AIR Developer’s Toolbox: Resources And Tutorials'>Adobe AIR Developer’s Toolbox: Resources And Tutorials</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>上次提到過<a title="Permanent Link to ActionScript and Flex optimization techniques and practices recommendation" rel="bookmark" href="../2009/04/actionscript-and-flex-optimization-techniques-and-practices-recommendation/">ActionScript and Flex optimization techniques and practices recommendation</a>，這次Adobe Air Team Blog發布了<a href="http://blogs.adobe.com/air/2009/05/performance_tips_for_adobe_air.html">Performance  Tips for Adobe AIR </a>。</p>
<p>總得來說有幾點可以參考：</p>
<ol>
<li>盡可能得減少 <kbd>mx:WindowedApplication:</kbd>frameRate。frameRate為Air的影格速率，比如Air默認的frameRate是24，那么它說明Air的影格一秒鐘要刷24次，相當于每41ms刷一次。Arno Gourdol推薦frameRate=7開始調校。</li>
<li>當Air程式APPLICATION_DEACTIVATE的時候，設定frameRate=1，減少CPU消耗。</li>
<li>盡可能得使用Timer而不是enterFrame進行相關的程式操作。enterFrame耗費相當大的資源。</li>
<li>如果是基于Adobe Flex的Air，使用profile觀察減少資源消耗。Flex的話，還是先從<a title="Permanent Link to ActionScript and Flex optimization techniques and practices recommendation" rel="bookmark" href="../2009/04/actionscript-and-flex-optimization-techniques-and-practices-recommendation/">ActionScript and Flex optimization techniques and practices recommendation</a>做起吧。</li>
</ol>
<p>更多參考：</p>
<ul>
<li><a href="http://arno.org/arnotify/2009/05/writing-well-behaved-efficient-air-applications/">Writing  well-behaved, efficient, AIR applications</a> by Arno Gourdo</li>
<li><a href="http://www.gskinner.com/blog/archives/2009/05/idle_cpu_usage.html">Idle  CPU Usage in Adobe AIR and Flash Player</a> on the Mac by Grant Skinne</li>
<li><a href="http://www.adobe.com/devnet/air/articles/air_performance.html">Performance-tuning  Adobe AIR applications</a></li>
<li><a href="http://blogs.adobe.com/simplicity/2008/11/high_perf_air_apps_max_2008.html">MAX  Talk: High Performance AIR Applications</a></li>
<li><a href="http://www.scribd.com/doc/8799584/Optimizing-AirFlash-Applications-Sean-Christmann">MAX  Talk: Optimizing Adobe AIR for Code Execution, Memory and Rendering</a></li>
</ul>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/04/actionscript-and-flex-optimization-techniques-and-practices-recommendation/' rel='bookmark' title='ActionScript and Flex optimization techniques and practices recommendation'>ActionScript and Flex optimization techniques and practices recommendation</a></li>
<li><a href='http://blog.richmediaplus.com/2009/09/10-tips-for-flex-application-performance/' rel='bookmark' title='10個 Adobe Flex 程式效能優化技巧'>10個 Adobe Flex 程式效能優化技巧</a></li>
<li><a href='http://blog.richmediaplus.com/2009/04/adobe-air-developer-toolbox-resources-and-tutorials/' rel='bookmark' title='Adobe AIR Developer’s Toolbox: Resources And Tutorials'>Adobe AIR Developer’s Toolbox: Resources And Tutorials</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2009/05/performance_tips_for_adobe_air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionScript and Flex optimization techniques and practices recommendation</title>
		<link>http://blog.richmediaplus.com/2009/04/actionscript-and-flex-optimization-techniques-and-practices-recommendation/</link>
		<comments>http://blog.richmediaplus.com/2009/04/actionscript-and-flex-optimization-techniques-and-practices-recommendation/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 15:00:19 +0000</pubDate>
		<dc:creator>Alvin / Aedis.Ju</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Techniques Optimization]]></category>
		<category><![CDATA[Adobe Flex]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=164</guid>
		<description><![CDATA[跟大多數語言一樣，ActionScript和Flex也有Techniques Optimization。 今天在InsideRIA發現一篇值得回味的文章51 ActionScript 3.0 and Flex optimization techniques and practices，這讓人想起了當初小組討論的時候，激烈討論過在for循環里面到底是var i:number = 0還是應該var i:int = 0快一點，還有類似很多這樣優化Flex的問題，這就是一篇可以解決當時相爭的文章。不過這篇文章作者有些地方寫得不正確，看看他的Comment吧，那是一片激烈的討論啊，里面有正解哦，實在不行，你自己可以測試啦。 關于ActionScript和Flex技術算法優化的文章，我還推薦Flex SDK coding conventions and best practices，它不僅僅對ActionScript和Flex技術算法進行優化，還推薦人們形成一種嚴謹的編碼規約，雖然這篇文章也沒有完全完成，有些還是待定的，但已經指引了我們編碼規約和最佳習慣一個正確的方向。 除了上述，記住還要時刻關注ActionScript和Flex的變化，比如目前最新的穩定版本Flex3.0.2，在Flashplayer version10和Air version1.5的情況下，已經可以支持Vector了。使用Vector實例時的數組元素訪問和迭代的速度比使用Array時的速度要快很多啊，不過要稍微注意一下運行環境哦。 Flex Techniques Optimization Recommendation： 51 ActionScript 3.0 and Flex optimization techniques and practices Flex SDK coding conventions and best practices As3 Speed Optimizations Related posts: Adobe Air程式效能優化技巧 10個 [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/05/performance_tips_for_adobe_air/' rel='bookmark' title='Adobe Air程式效能優化技巧'>Adobe Air程式效能優化技巧</a></li>
<li><a href='http://blog.richmediaplus.com/2009/09/10-tips-for-flex-application-performance/' rel='bookmark' title='10個 Adobe Flex 程式效能優化技巧'>10個 Adobe Flex 程式效能優化技巧</a></li>
<li><a href='http://blog.richmediaplus.com/2009/03/actionscript-client-for-the-facebook-platform-api-open/' rel='bookmark' title='Actionscript 3.0 Client for the Facebook Platform API Open'>Actionscript 3.0 Client for the Facebook Platform API Open</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>跟大多數語言一樣，ActionScript和Flex也有Techniques Optimization。</p>
<p>今天在InsideRIA發現一篇值得回味的文章<a href="http://www.insideria.com/2009/04/51-actionscript-30-and-flex-op.html" target="_blank">51 ActionScript 3.0 and Flex optimization techniques and practices</a>，這讓人想起了當初小組討論的時候，激烈討論過在for循環里面到底是var i:number = 0還是應該var i:int = 0快一點，還有類似很多這樣優化Flex的問題，這就是一篇可以解決當時相爭的文章。不過這篇文章作者有些地方寫得不正確，看看他的Comment吧，那是一片激烈的討論啊，里面有正解哦，實在不行，你自己可以測試啦。</p>
<p>關于ActionScript和Flex技術算法優化的文章，我還推薦<a href="http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions" target="_blank">Flex SDK coding conventions and best practices</a>，它不僅僅對ActionScript和Flex技術算法進行優化，還推薦人們形成一種嚴謹的編碼規約，雖然這篇文章也沒有完全完成，有些還是待定的，但已經指引了我們編碼規約和最佳習慣一個正確的方向。</p>
<p>除了上述，記住還要時刻關注ActionScript和Flex的變化，比如目前最新的穩定版本Flex3.0.2，在Flashplayer version10和Air version1.5的情況下，已經可以支持Vector了。使用Vector實例時的數組元素訪問和迭代的速度比使用Array時的速度要快很多啊，不過要稍微注意一下運行環境哦。</p>
<p><strong>Flex Techniques Optimization Recommendation</strong>：</p>
<ul>
<li><a href="http://www.insideria.com/2009/04/51-actionscript-30-and-flex-op.html" target="_blank">51 ActionScript 3.0 and Flex optimization techniques and practices</a></li>
<li><a href="http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions" target="_blank">Flex SDK coding conventions and best practices</a></li>
<li><a href="http://osflash.org/as3_speed_optimizations">As3 Speed Optimizations</a></li>
</ul>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/05/performance_tips_for_adobe_air/' rel='bookmark' title='Adobe Air程式效能優化技巧'>Adobe Air程式效能優化技巧</a></li>
<li><a href='http://blog.richmediaplus.com/2009/09/10-tips-for-flex-application-performance/' rel='bookmark' title='10個 Adobe Flex 程式效能優化技巧'>10個 Adobe Flex 程式效能優化技巧</a></li>
<li><a href='http://blog.richmediaplus.com/2009/03/actionscript-client-for-the-facebook-platform-api-open/' rel='bookmark' title='Actionscript 3.0 Client for the Facebook Platform API Open'>Actionscript 3.0 Client for the Facebook Platform API Open</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2009/04/actionscript-and-flex-optimization-techniques-and-practices-recommendation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>htmlFormat for Reduce DataBase Storage in Client</title>
		<link>http://blog.richmediaplus.com/2009/03/htmlformatforreducedatabasestorageinclient/</link>
		<comments>http://blog.richmediaplus.com/2009/03/htmlformatforreducedatabasestorageinclient/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 10:55:35 +0000</pubDate>
		<dc:creator>Alvin / Aedis.Ju</dc:creator>
				<category><![CDATA[ActionScript Library]]></category>
		<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[richmediaplus Lab]]></category>
		<category><![CDATA[Techniques Optimization]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[htmlFormat]]></category>
		<category><![CDATA[richmediaplus library]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=60</guid>
		<description><![CDATA[現在使用html標簽越來越頻繁，但是對Database的負擔也會隨之增加。 那么我們能不能自定義rules呢？ 下面舉個簡單的例子 比如一個 link(&#60;a target=”_blank” href=”http://www.yahoo.com.tw”&#62;&#60;u&#62;奇摩&#60;/u&#62;&#60;/a&#62;) 我們將會把它變成 [http://www.yahoo.com.tw&#124;&#124;奇摩] 然后再在Database進行存儲。相比而言，63個字符轉化29個字符，2：1的比例。考慮到其他的html標簽，我們至少能省掉數據庫一半的空間比例。 有些人說，這樣的做法不是加重了服務器的處理么？不不不，現在RIA普遍程度越來越大，很多以前放在后端的處理，都會直接放在前端進行處理。畢竟Server端只有一個，而Client端可以無窮。因此，我們只是在Client端做文章。 在向服務器存儲時，在Client端做standard_html到rule_html的處理。 在從服務器讀取時，在Client端做rule_html到standard_html的顯示。    下面貼出Client端做rule_html到standard_html的顯示Code: private static var headStr:String = &#34;[&#34;; private static var footStr:String = &#34;]&#34;; private static var centerStr:String = &#34;&#124;&#124;&#34;; /** * Replace Html Link * @param Link Format * @return htmlStr * @author Alvin */ public static function replaceHtmlLink&#40;htmlStr:String&#41;:String&#123; if&#40;htmlStr == [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/04/create-trail-information-and-expired-date-in-actionscript3-and-flex3/' rel='bookmark' title='Create Trail Information &amp; Expired Date in ActionScript3 &amp; Flex'>Create Trail Information &#038; Expired Date in ActionScript3 &#038; Flex</a></li>
<li><a href='http://blog.richmediaplus.com/2010/04/hit-test-target-hit-test-object/' rel='bookmark' title='hitTestTarget(source:DisplayObject, target:DisplayObject):Boolean'>hitTestTarget(source:DisplayObject, target:DisplayObject):Boolean</a></li>
<li><a href='http://blog.richmediaplus.com/2010/12/flex-flash-function/' rel='bookmark' title='Flex / Flash 性能优化技巧之 function'>Flex / Flash 性能优化技巧之 function</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>現在使用html標簽越來越頻繁，但是對Database的負擔也會隨之增加。</p>
<p>那么我們能不能自定義rules呢？</p>
<p>下面舉個簡單的例子</p>
<p>比如一個<br />
link(&lt;a target=”_blank” href=”http://www.yahoo.com.tw”&gt;&lt;u&gt;奇摩&lt;/u&gt;&lt;/a&gt;)<br />
我們將會把它變成<br />
[http://www.yahoo.com.tw||奇摩]<br />
然后再在Database進行存儲。相比而言，63個字符轉化29個字符，2：1的比例。考慮到其他的html標簽，我們至少能省掉數據庫一半的空間比例。</p>
<p>有些人說，這樣的做法不是加重了服務器的處理么？不不不，現在RIA普遍程度越來越大，很多以前放在后端的處理，都會直接放在前端進行處理。畢竟Server端只有一個，而Client端可以無窮。因此，我們只是在Client端做文章。</p>
<ul>
<li>在向服務器存儲時，在Client端做standard_html到rule_html的處理。</li>
<li>在從服務器讀取時，在Client端做rule_html到standard_html的顯示。</li>
</ul>
<p> </p>
<p> 下面貼出Client端做rule_html到standard_html的顯示Code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #6699cc; font-weight: bold;">var</span> headStr<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;[&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #6699cc; font-weight: bold;">var</span> footStr<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;]&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #6699cc; font-weight: bold;">var</span> centerStr<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;||&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #3f5fbf;">/**
* Replace Html Link
* @param Link Format
* @return htmlStr
* @author Alvin
*/</span>
<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> replaceHtmlLink<span style="color: #000000;">&#40;</span>htmlStr<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>htmlStr == <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000066; font-weight: bold;">||</span> htmlStr == <span style="color: #990000;">&quot;&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> tmpIndex<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = htmlStr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span>headStr<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> headFlag<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = tmpIndex <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000066; font-weight: bold;">?</span> <span style="color: #0033ff; font-weight: bold;">true</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>headFlag<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> headIndex<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = tmpIndex<span style="color: #000066; font-weight: bold;">;</span>
		tmpIndex = htmlStr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span>footStr<span style="color: #000066; font-weight: bold;">,</span> headIndex<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> footFlag<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = tmpIndex <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000066; font-weight: bold;">?</span> <span style="color: #0033ff; font-weight: bold;">true</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>footFlag<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> footIndex<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = tmpIndex<span style="color: #000066; font-weight: bold;">;</span>
			tmpIndex = htmlStr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">substring</span><span style="color: #000000;">&#40;</span>headIndex<span style="color: #000066; font-weight: bold;">,</span> footIndex<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span>centerStr<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> centerFlag<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = tmpIndex <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000066; font-weight: bold;">?</span> <span style="color: #0033ff; font-weight: bold;">true</span> <span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>centerFlag<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> centerIndex<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = tmpIndex <span style="color: #000066; font-weight: bold;">+</span> headIndex<span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> frontStr<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = htmlStr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">substring</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> headIndex<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> linkStr<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = htmlStr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">substring</span><span style="color: #000000;">&#40;</span>headIndex <span style="color: #000066; font-weight: bold;">+</span> headStr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">,</span> centerIndex<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> textStr<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = htmlStr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">substring</span><span style="color: #000000;">&#40;</span>centerIndex <span style="color: #000066; font-weight: bold;">+</span> centerStr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">,</span> footIndex<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> backStr<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = htmlStr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">substring</span><span style="color: #000000;">&#40;</span>footIndex <span style="color: #000066; font-weight: bold;">+</span> footStr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">,</span> htmlStr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>backStr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span>headStr<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					backStr = replaceHtmlLink<span style="color: #000000;">&#40;</span>backStr<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #000000;">&#125;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> lastStr<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = frontStr <span style="color: #000066; font-weight: bold;">+</span>
				<span style="color: #990000;">&quot;&lt;span style=&quot;</span><span style="color: #004993;">color</span><span style="color: #000066; font-weight: bold;">:</span> #00ddd0<span style="color: #000066; font-weight: bold;">;</span><span style="color: #990000;">&quot;&gt;&lt;a href=&quot;</span>\<span style="color: #990000;">&quot; target=&quot;</span>\<span style="color: #000066; font-weight: bold;">&amp;</span>quot<span style="color: #000066; font-weight: bold;">;</span>_blank\<span style="color: #000066; font-weight: bold;">&amp;</span>quot<span style="color: #000066; font-weight: bold;">;</span><span style="color: #990000;">&quot;&gt;&lt;span style=&quot;</span>text<span style="color: #000066; font-weight: bold;">-</span>decoration<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">underline</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #990000;">&quot;&gt;&quot;</span> <span style="color: #000066; font-weight: bold;">+</span> textStr <span style="color: #000066; font-weight: bold;">+</span><span style="color: #990000;">&quot;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&quot;</span>
				<span style="color: #000066; font-weight: bold;">+</span> backStr<span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #0033ff; font-weight: bold;">return</span> lastStr<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
	<span style="color: #0033ff; font-weight: bold;">return</span> htmlStr<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/04/create-trail-information-and-expired-date-in-actionscript3-and-flex3/' rel='bookmark' title='Create Trail Information &amp; Expired Date in ActionScript3 &amp; Flex'>Create Trail Information &#038; Expired Date in ActionScript3 &#038; Flex</a></li>
<li><a href='http://blog.richmediaplus.com/2010/04/hit-test-target-hit-test-object/' rel='bookmark' title='hitTestTarget(source:DisplayObject, target:DisplayObject):Boolean'>hitTestTarget(source:DisplayObject, target:DisplayObject):Boolean</a></li>
<li><a href='http://blog.richmediaplus.com/2010/12/flex-flash-function/' rel='bookmark' title='Flex / Flash 性能优化技巧之 function'>Flex / Flash 性能优化技巧之 function</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2009/03/htmlformatforreducedatabasestorageinclient/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

