<?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; JavaScript</title>
	<atom:link href="http://blog.richmediaplus.com/tag/javascript/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>Hack Swiffy Runtime</title>
		<link>http://blog.richmediaplus.com/2011/11/hack-swiffy-runtime/</link>
		<comments>http://blog.richmediaplus.com/2011/11/hack-swiffy-runtime/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 03:20:34 +0000</pubDate>
		<dc:creator>Ticore Shih</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ActionScript]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=898</guid>
		<description><![CDATA[由於 Google Swiffy 還不斷在修改，也沒有正式文件 很多 API 功能需要自行測試才會知道是否能用 雖然有支援基本 trace 功能，但是訊息都會變成一般字串輸出到 debug console 沒辦法像 JS or HTMLElement 物件那樣可以直接在 console 展開觀察屬性 另外，目前也不支援 ExternalInterface, fscommand 也不能讀取外部資料 可是明明都已經被轉成 JS 卻不能與 Swiffy runtime 外面 js 溝通取得 window, document，感覺這樣很笨 不過呢！測試著 function 時，突然發現以下的 AS 寫法 在轉換為 Swiffy 後，居然能取得 JS Window 物件！ function getDomWindow():Object{ return (function(){ return this; }).apply(null); } 有了 JS Window [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2011/06/js-cross-domain-inject-issue/' rel='bookmark' title='從 Flash 跨網域警告發現瀏覽器安全性漏洞'>從 Flash 跨網域警告發現瀏覽器安全性漏洞</a></li>
<li><a href='http://blog.richmediaplus.com/2011/11/google-swiffy-swf-to-html5/' rel='bookmark' title='測試 Google Swiffy 轉換工具'>測試 Google Swiffy 轉換工具</a></li>
<li><a href='http://blog.richmediaplus.com/2011/05/jquery-1-6-data-bug/' rel='bookmark' title='jQuery 1.6 data Bug'>jQuery 1.6 data Bug</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>由於 Google Swiffy 還不斷在修改，也沒有正式文件<br />
很多 API 功能需要自行測試才會知道是否能用<br />
雖然有支援基本 trace 功能，但是訊息都會變成一般字串輸出到 debug console<br />
沒辦法像 JS or HTMLElement 物件那樣可以直接在 console 展開觀察屬性</p>
<p>另外，目前也不支援 ExternalInterface, fscommand<br />
也不能讀取外部資料<br />
可是明明都已經被轉成 JS<br />
卻不能與 Swiffy runtime 外面 js 溝通取得 window, document，感覺這樣很笨</p>
<p>不過呢！測試著 function 時，突然發現以下的 AS 寫法<br />
在轉換為 Swiffy 後，居然能取得 JS Window 物件！</p>
<pre>
function getDomWindow():Object{
 return (function(){ return this; }).apply(null);
}
</pre>
<p>有了 JS Window 一切就好辦了<br />
可以直接呼叫 console.log 看看 runtime 裡的 _root 是什麼東西</p>
<pre>
getDomWindow().console.log(this);
</pre>
<p><a href="http://blog-uploads.richmediaplus.com/2011/11/HackSwiffyRuntime01.png"><img src="http://blog-uploads.richmediaplus.com/2011/11/HackSwiffyRuntime01-300x225.png" alt="" title="HackSwiffyRuntime01" width="300" height="225" class="alignnone size-medium wp-image-899" /></a></p>
<p>Swiffy runtime 的 _root 物件，所有屬性一覽無遺！<br />
接下來，想要在 Swiffy runtime 內與外部 JS 溝通，甚至讀取外部資料<br />
通通有解了吧！</p>
<p>以下示範從外部 JS 控制 Swiffy runtime 播放與停止功能<br />
先在 Flash 動畫內影格 1 加上以下 AS：</p>
<pre>
function getDomWindow():Object{
 return (function(){ return this; }).apply(null);
}

var window;

if (!window) {
 window = getDomWindow();
 window.runtimeStage = this;
}
</pre>
<p>輸出 Swiffy HTML 之後<br />
打開 HTML 文件多加上兩個按鈕就可以了</p>
<pre>
...
&lt;input type="button" value="stop" onClick="runtimeStage.stop();" /&gt;
&lt;input type="button" value="play" onClick="runtimeStage.play();" /&gt;
</pre>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2011/06/js-cross-domain-inject-issue/' rel='bookmark' title='從 Flash 跨網域警告發現瀏覽器安全性漏洞'>從 Flash 跨網域警告發現瀏覽器安全性漏洞</a></li>
<li><a href='http://blog.richmediaplus.com/2011/11/google-swiffy-swf-to-html5/' rel='bookmark' title='測試 Google Swiffy 轉換工具'>測試 Google Swiffy 轉換工具</a></li>
<li><a href='http://blog.richmediaplus.com/2011/05/jquery-1-6-data-bug/' rel='bookmark' title='jQuery 1.6 data Bug'>jQuery 1.6 data Bug</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2011/11/hack-swiffy-runtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>測試 Google Swiffy 轉換工具</title>
		<link>http://blog.richmediaplus.com/2011/11/google-swiffy-swf-to-html5/</link>
		<comments>http://blog.richmediaplus.com/2011/11/google-swiffy-swf-to-html5/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 15:46:48 +0000</pubDate>
		<dc:creator>Ticore Shih</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=893</guid>
		<description><![CDATA[最近 Google 推出了 Swiffy Extension 可以將 Flash SWF 檔案轉換為 HTML5/JS 版本 只要是 Flash CS4 以上都可以安裝 目前最新版本為 Swiffy 3.6.1 轉換功能目前已經支援大部分 ActionScript 1.0, 2.0 語法 一般按鈕事件、Clip 事件都已經支援了 影格聲音只支援 Event Sound 只能跑一次，無法 Loop 文字欄位只支援靜態文字，不能用程式改變內容，也不能輸入 動畫部分沒仔細測試，不過看起來一般 Flash 5 動畫都能正常轉換了 實際拿十年前做的一些小東西來轉轉看 滑鼠拖尾效果 HTML5 版 : Flash 版 以高速左右移動模擬物件 blur fade out 效果 HTML5 版 : Flash 版 簡單的 CAI 依照動畫提示順序將 [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2011/11/hack-swiffy-runtime/' rel='bookmark' title='Hack Swiffy Runtime'>Hack Swiffy Runtime</a></li>
<li><a href='http://blog.richmediaplus.com/2011/05/jquery-1-6-data-bug/' rel='bookmark' title='jQuery 1.6 data Bug'>jQuery 1.6 data Bug</a></li>
<li><a href='http://blog.richmediaplus.com/2011/06/js-cross-domain-inject-issue/' rel='bookmark' title='從 Flash 跨網域警告發現瀏覽器安全性漏洞'>從 Flash 跨網域警告發現瀏覽器安全性漏洞</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>最近 Google 推出了 <a href="http://www.google.com/doubleclick/studio/swiffy/">Swiffy Extension</a> 可以將 Flash SWF 檔案轉換為 HTML5/JS 版本<br />
只要是 Flash CS4 以上都可以安裝<br />
目前最新版本為 Swiffy 3.6.1<br />
轉換功能目前已經支援大部分 ActionScript 1.0, 2.0 語法<br />
一般按鈕事件、Clip 事件都已經支援了<br />
影格聲音只支援 Event Sound 只能跑一次，無法 Loop<br />
文字欄位只支援靜態文字，不能用程式改變內容，也不能輸入<br />
動畫部分沒仔細測試，不過看起來一般 Flash 5 動畫都能正常轉換了</p>
<p>實際拿十年前做的一些小東西來轉轉看</p>
<p>滑鼠拖尾效果 <a href="http://dl.dropbox.com/u/9302854/SwiffyTest/Arrow9.swf.html">HTML5 版</a> : <a href="http://dl.dropbox.com/u/9302854/SwiffyTest/Arrow9.swf.html">Flash 版</a></p>
<p><a href="http://blog-uploads.richmediaplus.com/2011/11/SWFArrow9.png"><img src="http://blog-uploads.richmediaplus.com/2011/11/SWFArrow9-300x218.png" alt="" title="SWFArrow9" width="300" height="218" class="alignnone size-medium wp-image-894" /></a></p>
<p>以高速左右移動模擬物件 blur fade out 效果<br />
<a href="http://dl.dropbox.com/u/9302854/SwiffyTest/Transition_03.swf.html">HTML5 版</a> : <a href="http://dl.dropbox.com/u/9302854/SwiffyTest/Transition_03.swf">Flash 版</a></p>
<p><a href="http://blog-uploads.richmediaplus.com/2011/11/SWFBlurFadeOut.png"><img src="http://blog-uploads.richmediaplus.com/2011/11/SWFBlurFadeOut-300x218.png" alt="" title="SWFBlurFadeOut" width="300" height="218" class="alignnone size-medium wp-image-895" /></a></p>
<p>簡單的 CAI 依照動畫提示順序將 1-10 數字按一遍<br />
<a href="http://dl.dropbox.com/u/9302854/SwiffyTest/123.swf.html">HTML5 版</a> : <a href="http://dl.dropbox.com/u/9302854/SwiffyTest/123.swf">Flash 版</a></p>
<p><a href="http://blog-uploads.richmediaplus.com/2011/11/SWFCAI123.png"><img src="http://blog-uploads.richmediaplus.com/2011/11/SWFCAI123-300x222.png" alt="" title="SWFCAI123" width="300" height="222" class="alignnone size-medium wp-image-896" /></a></p>
<p>我知道這些東西看起來有點弱，不過十年前剛開始學 Flash 5 與程式只能做這種東西<br />
太複雜困難的東西，目前也無法轉成 HTML5<br />
即便如此，Flash Tool + Swiffy 大概是目前最好用的 HTML5 動畫、互動開發工具了<br />
你可以想像這些東西用文字編輯器 + PS 要刻多久嗎? 一個小互動 AD Banner 才多少?</p>
<p>需要注意的是 Swiffy 產生出來的 JSON 資料，經過 GZIP 壓縮後，檔案大小平均膨脹 13% 左右<br />
除此之外，還需要一個 Swify runtime.js<br />
以一個最簡單的例子做測試，僅在 frame 1 加上 AS: trace($version);<br />
產生的 HTML 如下：</p>
<pre>
&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;title&gt;Swiffy output&lt;/title&gt;
&lt;script src="http://www.gstatic.com/swiffy/v3.6/runtime.js"&gt;&lt;/script&gt;
&lt;script&gt;
swiffyobject = {"tags":[{"type":9,"actions":
[{"value":"$version","type":305},{"type":28},{"type":38}]},{"type":2}],
"v":"3.6.1","backgroundColor":16777215,
"frameSize":{"ymin":0,"ymax":4000,"xmin":0,"xmax":6000},
"frameCount":1,"frameRate":24,"version":8};
&lt;/script&gt;
&lt;/head&gt;
&lt;body style="overflow:hidden;margin:0;"&gt;
&lt;script&gt;var stage = new swiffy.Stage(document.body, swiffyobject);&lt;/script&gt;
&lt;script&gt;stage.start();&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>trace 結果會直接輸出到瀏覽器的 debug console 上<br />
假如想要傳入額外的參數到 HTML5 版的 Flash<br />
可以在 stage.start(); 之前呼叫：</p>
<pre>
stage.setFlashVars("clickTAG=http://www.google.com");
</pre>
<p>轉換時假如遇到不支援的物件或是語法，Swiffy 會出現警告訊息<br />
以下列出 Swiffy 3.6.1 可能會出現的 Warning 做為參考</p>
<p>Advanced text rendering using continuous stroke modulation is not supported.<br />
An unsupported ActionScript instruction was encountered.<br />
Blend modes are not supported.<br />
Different stroke cap styles for start and end are not supported.<br />
Filters are not supported by (Mobile) Safari.<br />
Input text is not supported<br />
Linear RGB color interpolation for gradients is not supported on certain platforms.<br />
Loading ActionScript variables from a URL is not supported.<br />
Loading a URL into a MovieClip is not supported.<br />
Miter limit will behave differently, as it will revert to bevel instead of cutting off the joint.<br />
Modifying the tab order is not supported.<br />
Streaming audio is not supported.<br />
The ActionScript class BitmapData is not supported.<br />
The ActionScript class BlurFilter is not supported.<br />
The ActionScript class Error is not supported.<br />
The ActionScript class LoadVars is not supported.<br />
The ActionScript class LocalConnection is not supported.<br />
The ActionScript class NetConnection is not supported.<br />
The ActionScript class Point is not supported.<br />
The ActionScript class Rectangle is not supported.<br />
The ActionScript class Sound is not supported.<br />
The ActionScript class TextFormat is not supported.<br />
The ActionScript class XML is not supported.<br />
The ActionScript class XMLSocket is not supported.<br />
The ActionScript function updateAfterEvent is not supported.<br />
The ActionScript method MovieClip.attachBitmap() is not supported.<br />
The ActionScript method MovieClip.beginFill() is not supported.<br />
The ActionScript method MovieClip.createEmptyMovieClip() is not supported.<br />
The ActionScript method MovieClip.createTextField() is not supported.<br />
The ActionScript method MovieClip.curveTo() is not supported.<br />
The ActionScript method MovieClip.endFill() is not supported.<br />
The ActionScript method MovieClip.getBytesLoaded() is not supported.<br />
The ActionScript method MovieClip.getBytesTotal() is not supported.<br />
The ActionScript method MovieClip.getDepth() is not supported.<br />
The ActionScript method MovieClip.getInstanceAtDepth() is not supported.<br />
The ActionScript method MovieClip.getNextHighestDepth() is not supported.<br />
The ActionScript method MovieClip.lineStyle() is not supported.<br />
The ActionScript method MovieClip.lineTo() is not supported.<br />
The ActionScript method MovieClip.loadMovie() is not supported.<br />
The ActionScript method MovieClip.moveTo() is not supported.<br />
The ActionScript method MovieClip.onRollOut() is not supported.<br />
The ActionScript method MovieClip.onRollOver() is not supported.<br />
The ActionScript method MovieClip.setMask() is not supported.<br />
The ActionScript method MovieClip.swapDepths() is not supported.<br />
The ActionScript method MovieClip.unloadMovie() is not supported.<br />
The ActionScript method Object.addProperty() is not supported.<br />
The ActionScript property arguments is not supported.<br />
The ActionScript property MovieClip.filters is not supported.<br />
The ActionScript property System.capabilities is not supported.<br />
The fscommand action is not supported.<br />
The global ActionScript property _accProps is not supported.<br />
The global ActionScript property _level1 is not supported.</p>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2011/11/hack-swiffy-runtime/' rel='bookmark' title='Hack Swiffy Runtime'>Hack Swiffy Runtime</a></li>
<li><a href='http://blog.richmediaplus.com/2011/05/jquery-1-6-data-bug/' rel='bookmark' title='jQuery 1.6 data Bug'>jQuery 1.6 data Bug</a></li>
<li><a href='http://blog.richmediaplus.com/2011/06/js-cross-domain-inject-issue/' rel='bookmark' title='從 Flash 跨網域警告發現瀏覽器安全性漏洞'>從 Flash 跨網域警告發現瀏覽器安全性漏洞</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2011/11/google-swiffy-swf-to-html5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>從 Flash 跨網域警告發現瀏覽器安全性漏洞</title>
		<link>http://blog.richmediaplus.com/2011/06/js-cross-domain-inject-issue/</link>
		<comments>http://blog.richmediaplus.com/2011/06/js-cross-domain-inject-issue/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 10:55:47 +0000</pubDate>
		<dc:creator>Ticore Shih</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=789</guid>
		<description><![CDATA[論壇上有人問到 Chrome 瀏覽器上跨域 iframe 會出現 Flash 安全性的警告 而且在 Google Code 上也有人提出相同的問題 http://code.google.com/p/swfobject/issues/detail?id=481 http://code.google.com/p/chromium/issues/detail?id=76748 反覆測試之後，將問題簡化如下： a.com 下的 HTML 網頁，包含一個 b.com 來的 iframe 網頁 b.com iframe 網頁內使用 javascript touch 一下 window.top.location a.com 在 onload 完成後，動態建立一 Flash 物件 Flash 物件內透過 ExternalInterface 呼叫任何 Javascript Function 得到以下錯誤訊息 SecurityError: Error #2060: 執行程序安全性違規：ExternalInterface 呼叫者 http://a.com/flash.swf 無法存取 [object]。 at flash.external::ExternalInterface$/_initJS() at flash.external::ExternalInterface$/call() at [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2011/11/hack-swiffy-runtime/' rel='bookmark' title='Hack Swiffy Runtime'>Hack Swiffy Runtime</a></li>
<li><a href='http://blog.richmediaplus.com/2011/05/jquery-1-6-data-bug/' rel='bookmark' title='jQuery 1.6 data Bug'>jQuery 1.6 data Bug</a></li>
<li><a href='http://blog.richmediaplus.com/2010/01/open-source-javascript-flashplayer-html5-svg/' rel='bookmark' title='開源JavaScript Flash Player(HTML5/SVG)'>開源JavaScript Flash Player(HTML5/SVG)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>論壇上有人問到 <a href="http://bbs.9ria.com/thread-85933-1-1.html">Chrome 瀏覽器上跨域 iframe 會出現 Flash 安全性的警告</a><br />
而且在 Google Code 上也有人提出相同的問題<br />
<a href="http://code.google.com/p/swfobject/issues/detail?id=481">http://code.google.com/p/swfobject/issues/detail?id=481</a><br />
<a href="http://code.google.com/p/chromium/issues/detail?id=76748">http://code.google.com/p/chromium/issues/detail?id=76748</a></p>
<p>反覆測試之後，將問題簡化如下：</p>
<ol>
<li>a.com 下的 HTML 網頁，包含一個 b.com 來的 iframe 網頁</li>
<li>b.com iframe 網頁內使用 javascript touch 一下 window.top.location</li>
<li>a.com 在 onload 完成後，動態建立一 Flash 物件</li>
<li>Flash 物件內透過 ExternalInterface 呼叫任何 Javascript Function</li>
<li>得到以下錯誤訊息</li>
</ol>
<p><code>SecurityError: Error #2060: 執行程序安全性違規：ExternalInterface 呼叫者 http://a.com/flash.swf 無法存取 [object]。<br />
at flash.external::ExternalInterface$/_initJS()<br />
at flash.external::ExternalInterface$/call()<br />
at flash_fla::MainTimeline/doCallJs()</code></p>
<p>已經簡化成這樣，很明顯問題是出在 javascript window.top.location 物件上<br />
想要避免該問題，只要在主頁上一載入立即搶先 touch window.top.location 就好了</p>
<p>在測試過程中，還發現另一個更嚴重的問題<br />
跨域的 iframe 能夠透過原型鍊 prototype 插入任意 function 到 location 物件上<br />
讓 top window 頁面呼叫並傳遞任何物件<br />
不受跨網域安全性的限制</p>
<p>以下是實際的測試程式：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">http://a.com/index01.html
&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;title&gt;&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function onLoad() {
	console.log(&quot;'fun' in location: &quot;, &quot;fun&quot; in window.location);
	console.log(&quot;'fun' in document: &quot;, &quot;fun&quot; in document);
	if (&quot;fun&quot; in window.location)
		console.log(window.location.fun());
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onLoad=&quot;onLoad();&quot;&gt;
    &lt;iframe width=&quot;100&quot; height=&quot;100&quot;
    	src=&quot;http://b.com/index02.html&quot;&gt;
    &lt;/iframe&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">// http://b.com/index02.html
&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
// Make sure touch top window location first in all frames, get the hook to inject function.
window.top.location;
//*/ Inject cross domain function via Object.prototype
Object.prototype.fun = function() {
	return(&quot;from iframe : &quot; + window.location);
};
//*/
/*/ Inject cross domain function via location.__proto__
window.location.__proto__.fun = function() {
	return(&quot;from iframe : &quot; + window.location);
};
//*/
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>實際用 Chrome 瀏覽器測試得到以下的結果</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">'fun' in location:  true
'fun' in document:  false
from iframe : http://b.com/index02.html</pre></div></div>

<p>跨網域 iframe 插入的 fun 真的能夠在主頁偵測到，並且呼叫之<br />
以上的 Bug 至少會發生在 Chrome 12.0.742.100 上</p>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2011/11/hack-swiffy-runtime/' rel='bookmark' title='Hack Swiffy Runtime'>Hack Swiffy Runtime</a></li>
<li><a href='http://blog.richmediaplus.com/2011/05/jquery-1-6-data-bug/' rel='bookmark' title='jQuery 1.6 data Bug'>jQuery 1.6 data Bug</a></li>
<li><a href='http://blog.richmediaplus.com/2010/01/open-source-javascript-flashplayer-html5-svg/' rel='bookmark' title='開源JavaScript Flash Player(HTML5/SVG)'>開源JavaScript Flash Player(HTML5/SVG)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2011/06/js-cross-domain-inject-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>正確避免浮點數計算偏差問題</title>
		<link>http://blog.richmediaplus.com/2011/05/avoid-folat-point-precision-issue/</link>
		<comments>http://blog.richmediaplus.com/2011/05/avoid-folat-point-precision-issue/#comments</comments>
		<pubDate>Tue, 17 May 2011 02:52:21 +0000</pubDate>
		<dc:creator>Ticore Shih</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ActionScript]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=752</guid>
		<description><![CDATA[不管是用哪一種語言，只要關於浮點數運算一定會出現偏差 譬如 AS3 or Javascript 執行 152.2938 * 100 會輸出 15229.380000000001 當然最精確的作法是改用大數 BigDecimal 類別 假如一般不需要用到那麼精確，又要避開浮點數運算偏差的問題 最常見的作法可能就是直接用浮點數乘 100，四捨五入之後再除以 100 了 網路上很多現成的 function 可以用 function roundFloat&#40;value:Number, divider:Number&#41;:Number&#123; return Math.round&#40;value * divider&#41; / divider; &#125; 問題來了，那個除數大小到底該怎樣決定呢? 你可能會覺得很簡單，需要精確到小數下兩位就用 100，精確到三位就用 1000 可是這樣的用法正確嗎? 雙精度浮點數有效位數是 15-16 位 整數位數多，小數有效位數就減少，反之亦然 倘若整數占了 13 位，算式精確到小數 3 位只是自己騙自己而已 倘若整數占了 3 位，算式精確到小數 3 位則是浪費浮點數的有效位數 很明顯固定抓小數 3 位的作法無法適用絕大部分情況 假如需要計算整數位數少，小數位數多情況 [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2011/05/decide-folat-point-precision/' rel='bookmark' title='決定浮點數有效位數'>決定浮點數有效位數</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>
<li><a href='http://blog.richmediaplus.com/2011/11/hack-swiffy-runtime/' rel='bookmark' title='Hack Swiffy Runtime'>Hack Swiffy Runtime</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>不管是用哪一種語言，只要關於浮點數運算一定會出現偏差<br />
譬如 AS3 or Javascript 執行 152.2938 * 100<br />
會輸出 15229.380000000001<br />
當然最精確的作法是改用大數 BigDecimal 類別</p>
<p>假如一般不需要用到那麼精確，又要避開浮點數運算偏差的問題<br />
最常見的作法可能就是直接用浮點數乘 100，四捨五入之後再除以 100 了<br />
網路上很多現成的 function 可以用</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #339966; font-weight: bold;">function</span> roundFloat<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: #000066; font-weight: bold;">,</span> divider<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;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">round</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span> <span style="color: #000066; font-weight: bold;">*</span> divider<span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">/</span> divider<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>問題來了，那個除數大小到底該怎樣決定呢?<br />
你可能會覺得很簡單，需要精確到小數下兩位就用 100，精確到三位就用 1000</p>
<p>可是這樣的用法正確嗎?</p>
<p>雙精度浮點數有效位數是 15-16 位<br />
整數位數多，小數有效位數就減少，反之亦然<br />
倘若整數占了 13 位，算式精確到小數 3 位只是自己騙自己而已<br />
倘若整數占了 3 位，算式精確到小數 3 位則是浪費浮點數的有效位數</p>
<p>很明顯固定抓小數 3 位的作法無法適用絕大部分情況<br />
假如需要計算整數位數少，小數位數多情況<br />
就增加 divider 參數，反之就要縮小 divider<br />
無法用同一個算式計算大小不同的數值<br />
這樣寫法實在有點笨</p>
<p>而且上面 function 內容真的很少，為了這問題<br />
所有的地方都要 import 並呼叫這個 function<br />
好像有點過頭了<br />
倘若全部都改成 inline 的算式好像又顯得雜亂<br />
畢竟每個地方用到的 divider 大小可能不一樣</p>
<p>以下分享一個更簡單的作法，且能更有效的利用浮點數所有的有效位數<br />
利用 Number.toPrecision 指定轉成固定精確度 15 的字串<br />
這樣一轉，有效位數外的浮點數計算偏差就被去除掉了<br />
然後再用 parseFloat 轉回浮點數</p>
<p>實際測試範例：</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// 整數位數五位的情況，能夠進行到小數下 8 位的運算不受偏差影響</span>
<span style="color: #6699cc; font-weight: bold;">var</span> no<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">152.2938</span> <span style="color: #000066; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">100</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">0.00000001</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>no<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #009900; font-style: italic;">// 15229.380000010002 &amp;lt;- 浮點數計算偏差</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">parseFloat</span><span style="color: #000000;">&#40;</span>no<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">toPrecision</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">15</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #009900; font-style: italic;">// 15229.38000001 &lt;- 修正浮點數計算偏差</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// 整數位數 10 位的情況，能夠進行到小數下 3 位的運算不受偏差影響</span>
<span style="color: #6699cc; font-weight: bold;">var</span> no<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">1234567890</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight:bold;">9</span> <span style="color: #000066; font-weight: bold;">;</span> <span style="color: #000066; font-weight: bold;">++</span>i<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
 <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>no <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">0.011</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
 <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>no = <span style="color: #004993;">parseFloat</span><span style="color: #000000;">&#40;</span>no<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">toPrecision</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">15</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #009966; font-style: italic;">/*/</span>
<span style="color: #000000; font-weight:bold;">1234567890.011</span>
<span style="color: #000000; font-weight:bold;">1234567890.011</span>
<span style="color: #000000; font-weight:bold;">1234567890.0219998</span>  <span style="color: #000066; font-weight: bold;">&lt;-</span> 浮點數計算偏差
<span style="color: #000000; font-weight:bold;">1234567890.022</span>      <span style="color: #000066; font-weight: bold;">&lt;-</span> 修正浮點數計算偏差
<span style="color: #000000; font-weight:bold;">1234567890.033</span>
<span style="color: #000000; font-weight:bold;">1234567890.033</span>
<span style="color: #000000; font-weight:bold;">1234567890.044</span>
<span style="color: #000000; font-weight:bold;">1234567890.044</span>
<span style="color: #000000; font-weight:bold;">1234567890.0549998</span>  <span style="color: #000066; font-weight: bold;">&lt;-</span> 浮點數計算偏差
<span style="color: #000000; font-weight:bold;">1234567890.055</span>      <span style="color: #000066; font-weight: bold;">&lt;-</span> 修正浮點數計算偏差
<span style="color: #000000; font-weight:bold;">1234567890.066</span>
<span style="color: #000000; font-weight:bold;">1234567890.066</span>
<span style="color: #000000; font-weight:bold;">1234567890.077</span>
<span style="color: #000000; font-weight:bold;">1234567890.077</span>
<span style="color: #000000; font-weight:bold;">1234567890.0879998</span>  <span style="color: #000066; font-weight: bold;">&lt;-</span> 浮點數計算偏差
<span style="color: #000000; font-weight:bold;">1234567890.088</span>      <span style="color: #000066; font-weight: bold;">&lt;-</span> 修正浮點數計算偏差
<span style="color: #000000; font-weight:bold;">1234567890.099</span>
<span style="color: #000000; font-weight:bold;">1234567890.099</span>
<span style="color: #009900; font-style: italic;">//*/</span></pre></div></div>

<p><del datetime="2011-05-17T05:55:41+00:00">除了 Number.toPrecision 之外也可以使用 Number.toExponential<br />
trace(Number(no.toExponential(15)));</del><br />
AS3 不能用 toExponential，它似乎不會四捨五入<br />
trace((0.3213).toExponential(10)); // 3.2129999999e-1</p>
<p>以上的方式簡單到根本沒有必要獨立寫成一個 function，<del datetime="2011-05-17T08:40:25+00:00">也不需要設置不同參數</del><br />
一律 inline 使用就好了<br />
需要注意的是 Precision 的取捨，看運算的數值多大，需要決定不同的 Precision</p>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2011/05/decide-folat-point-precision/' rel='bookmark' title='決定浮點數有效位數'>決定浮點數有效位數</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>
<li><a href='http://blog.richmediaplus.com/2011/11/hack-swiffy-runtime/' rel='bookmark' title='Hack Swiffy Runtime'>Hack Swiffy Runtime</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2011/05/avoid-folat-point-precision-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery 1.6 data Bug</title>
		<link>http://blog.richmediaplus.com/2011/05/jquery-1-6-data-bug/</link>
		<comments>http://blog.richmediaplus.com/2011/05/jquery-1-6-data-bug/#comments</comments>
		<pubDate>Thu, 05 May 2011 05:36:57 +0000</pubDate>
		<dc:creator>Ticore Shih</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=750</guid>
		<description><![CDATA[最近 jQuery 更新到 1.6 版，雖然我沒有在用 可是還是測試看看新功能 結果發現新的 data 功能有 bug jQuery 1.6 data() bug demo code: &#60;!DOCTYPE HTML&#62; &#60;html&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34;&#62; &#60;title&#62;jQuery 1.6 data() Bug&#60;/title&#62; &#60;script type=&#34;text/javascript&#34; src=&#34;jquery-1.6.js&#34;&#62;&#60;/script&#62; &#60;script type=&#34;text/javascript&#34;&#62; $&#40;function &#40;&#41; &#123; $&#40;&#34;span&#34;&#41;.each&#40;function&#40;&#41;&#123; console.log&#40;JSON.stringify&#40;$&#40;this&#41;.data&#40;&#41;&#41;&#41;; &#125;&#41;; &#125;&#41;; &#60;/script&#62; &#60;/head&#62; &#60;body&#62; &#60;span data-x=&#34;data&#34; /&#62; &#60;span data-x-x=&#34;data&#34; /&#62; &#60;span data-x-x-x=&#34;data&#34; /&#62; &#60;span data-x-xx-x=&#34;data&#34; /&#62; [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2010/01/open-source-javascript-flashplayer-html5-svg/' rel='bookmark' title='開源JavaScript Flash Player(HTML5/SVG)'>開源JavaScript Flash Player(HTML5/SVG)</a></li>
<li><a href='http://blog.richmediaplus.com/2011/06/js-cross-domain-inject-issue/' rel='bookmark' title='從 Flash 跨網域警告發現瀏覽器安全性漏洞'>從 Flash 跨網域警告發現瀏覽器安全性漏洞</a></li>
<li><a href='http://blog.richmediaplus.com/2009/03/chromeexperiments/' rel='bookmark' title='Chrome Javascript Experience in ChromeExperiments.Com'>Chrome Javascript Experience in ChromeExperiments.Com</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>最近 <a href="http://blog.jquery.com/2011/05/03/jquery-16-released/" target="_blank">jQuery 更新到 1.6 版</a>，雖然我沒有在用<br />
可是還是測試看看新功能<br />
結果發現新的 data 功能有 bug</p>
<p>jQuery 1.6 data() bug demo code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
&lt;title&gt;jQuery 1.6 data() Bug&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.6.js&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;span&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>JSON.<span style="color: #660066;">stringify</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;/head&gt;
&lt;body&gt;
&lt;span data-x=&quot;data&quot; /&gt;
&lt;span data-x-x=&quot;data&quot; /&gt;
&lt;span data-x-x-x=&quot;data&quot; /&gt;
&lt;span data-x-xx-x=&quot;data&quot; /&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>用 Chrome 瀏覽器執行輸出結果</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;x&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;data&quot;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;xX&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;data&quot;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;xXxX&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;data&quot;</span><span style="color: #009900;">&#125;</span></pre></div></div>

<p>實在令人搞不懂，為什麼 data attribute 這樣寫 data-x-x-x 就不能 parse 了呢?<br />
其它三個類似的寫法卻又可以正常 work</p>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2010/01/open-source-javascript-flashplayer-html5-svg/' rel='bookmark' title='開源JavaScript Flash Player(HTML5/SVG)'>開源JavaScript Flash Player(HTML5/SVG)</a></li>
<li><a href='http://blog.richmediaplus.com/2011/06/js-cross-domain-inject-issue/' rel='bookmark' title='從 Flash 跨網域警告發現瀏覽器安全性漏洞'>從 Flash 跨網域警告發現瀏覽器安全性漏洞</a></li>
<li><a href='http://blog.richmediaplus.com/2009/03/chromeexperiments/' rel='bookmark' title='Chrome Javascript Experience in ChromeExperiments.Com'>Chrome Javascript Experience in ChromeExperiments.Com</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2011/05/jquery-1-6-data-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>開源JavaScript Flash Player(HTML5/SVG)</title>
		<link>http://blog.richmediaplus.com/2010/01/open-source-javascript-flashplayer-html5-svg/</link>
		<comments>http://blog.richmediaplus.com/2010/01/open-source-javascript-flashplayer-html5-svg/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 15:22:46 +0000</pubDate>
		<dc:creator>Alvin / Aedis.Ju</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Life is Cool!]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SVG]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=471</guid>
		<description><![CDATA[開發者Tobias Schneider在JavaScript中編寫了一個Flash解釋程式，名叫Gordon的開來源程式允許在支援SVG/HTML5的流覽器——iPhone內置了SVG支援——上播放Flash。 儘管程式開發還只是處於初始階段，但顯示它很有希望。開發者已在網站了公佈了一些演示。目前支持的流覽器包括：Chrome 3.0.195.38（能正常運行Demo），Chrome 4.0.298.0 Linux（會在滑鼠移動時出現崩潰），基於Web-Kit的Epiphany，Firefox 3.6，Safari 4；Demo無法在Opera 10.10和10.50上工作，未測試IE流覽器（因為不支援SVG）。 &#8211;來源于solidot.org Flash is coming to the iPhone, but it&#8217;s no thanks to Adobe or Apple. It&#8217;s thanks to Gordon. These are demos of Gordon &#8211; An open source Flash™ runtime written in pure JavaScript with SVG blue.html (&#38; its .swf) tiger.html (&#38; its .swf) trip.html (&#38; [...]
Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/10/adobe-flash-player-10-1/' rel='bookmark' title='Adobe Flash Player 10.1'>Adobe Flash Player 10.1</a></li>
<li><a href='http://blog.richmediaplus.com/2011/06/js-cross-domain-inject-issue/' rel='bookmark' title='從 Flash 跨網域警告發現瀏覽器安全性漏洞'>從 Flash 跨網域警告發現瀏覽器安全性漏洞</a></li>
<li><a href='http://blog.richmediaplus.com/2010/04/thoughts-on-flash-in-chinese-link/' rel='bookmark' title='Thoughts on Flash in Chinese Link'>Thoughts on Flash in Chinese Link</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<blockquote><p>開發者<a href="http://github.com/tobeytailor">Tobias Schneider</a>在JavaScript中編寫了<a href="http://tech.slashdot.org/story/10/01/19/1533250/Open-Source-JavaScript-Flash-Player-HTML5SVG">一個Flash解釋程式</a>，名叫<a href="http://github.com/tobeytailor/gordon">Gordon</a>的開來源程式允許在支援SVG/HTML5的流覽器——iPhone內置了SVG支援——上播放Flash。<em> 儘管程式開發還只是處於初始階段，但顯示它很有希望。開發者已在網站了公佈了一些<a href="http://paulirish.com/work/gordon/demos/">演示</a>。目前支持的流覽器<a href="http://wiki.github.com/tobeytailor/gordon/browser-support-table">包括</a>：Chrome  3.0.195.38（能正常運行Demo），Chrome 4.0.298.0  Linux（會在滑鼠移動時出現崩潰），基於Web-Kit的Epiphany，Firefox 3.6，Safari 4；Demo無法在Opera  10.10和10.50上工作，未測試IE流覽器（因為不支援SVG）。</em><br />
<strong>&#8211;來源于solidot.org</strong></p></blockquote>
<p><strong><br />
<em>Flash is coming to the iPhone, but it&#8217;s no thanks to Adobe or Apple. It&#8217;s thanks to Gordon.</em></strong><br />
<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>These are demos of <a href="http://github.com/tobeytailor/gordon">Gordon &#8211; An  open source Flash™ runtime written in pure JavaScript with SVG</a></p>
<ul>
<li><a href="http://paulirish.com/work/gordon/demos/blue.html">blue.html</a> <small>(&amp; <a href="http://paulirish.com/work/gordon/demos/blue.swf">its  .swf</a>)</small></li>
<li><a href="http://paulirish.com/work/gordon/demos/tiger.html">tiger.html</a> <small>(&amp; <a href="http://paulirish.com/work/gordon/demos/tiger.swf">its  .swf</a>)</small></li>
<li><a href="http://paulirish.com/work/gordon/demos/trip.html">trip.html</a> <small>(&amp; <a href="http://paulirish.com/work/gordon/demos/trip.swf">its  .swf</a>)</small></li>
<li><a href="http://jancona.com/gordon/demos/buttons.html">button.html</a> <small>(just added!)</small></li>
<li><a href="http://davididas.com/gordon/test1.html">apple lightning</a> <small>(just added!)</small></li>
</ul>
<p>Related posts:<ol>
<li><a href='http://blog.richmediaplus.com/2009/10/adobe-flash-player-10-1/' rel='bookmark' title='Adobe Flash Player 10.1'>Adobe Flash Player 10.1</a></li>
<li><a href='http://blog.richmediaplus.com/2011/06/js-cross-domain-inject-issue/' rel='bookmark' title='從 Flash 跨網域警告發現瀏覽器安全性漏洞'>從 Flash 跨網域警告發現瀏覽器安全性漏洞</a></li>
<li><a href='http://blog.richmediaplus.com/2010/04/thoughts-on-flash-in-chinese-link/' rel='bookmark' title='Thoughts on Flash in Chinese Link'>Thoughts on Flash in Chinese Link</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2010/01/open-source-javascript-flashplayer-html5-svg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chrome Javascript Experience in ChromeExperiments.Com</title>
		<link>http://blog.richmediaplus.com/2009/03/chromeexperiments/</link>
		<comments>http://blog.richmediaplus.com/2009/03/chromeexperiments/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 07:16:17 +0000</pubDate>
		<dc:creator>Alvin / Aedis.Ju</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.richmediaplus.com/?p=86</guid>
		<description><![CDATA[Chrome又有了新動作，我講的這次不是beta版本的更新，而是他們推出了ChromeExperiments.Com，展示了Chrome和V8 Javascript在游戲，應用程序，虛擬化的實力。如果你想看到里面精彩的例子，你最好必須裝有Chrome瀏覽器。因為有些case在IE和Firefox里面跑不出來&#8230; Btw：目前為止Chrome對Javascript的兼容性做的不是很好，上次寫一個方法浪費了我一個晚上！Fuck Chrome! No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Chrome又有了新動作，我講的這次不是beta版本的更新，而是他們推出了<a title="Chrome Experiments" href="http://www.chromeexperiments.com/" target="_blank">ChromeExperiments.Com</a>，展示了<a title="Chrome" href="http://www.google.com/chrome" target="_blank">Chrome</a>和<a title="V8 Javascript" href="http://code.google.com/p/v8/" target="_blank">V8 Javascript</a>在游戲，應用程序，虛擬化的實力。如果你想看到里面精彩的例子，你最好必須裝有Chrome瀏覽器。因為有些case在IE和Firefox里面跑不出來&#8230;</p>
<p>Btw：目前為止Chrome對Javascript的兼容性做的不是很好，上次寫一個方法浪費了我一個晚上！Fuck Chrome!</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.richmediaplus.com/2009/03/chromeexperiments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

