<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DEYBQHk5eCp7ImA9WhRUFko.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040</id><updated>2012-01-27T22:55:51.720+08:00</updated><category term="loaderInfo" /><category term="Compiler" /><category term="Performance" /><category term="Flash-Builder-4" /><category term="Path" /><category term="TextField" /><category term="AS1" /><category term="Bug" /><category term="Metadata-Tag" /><category term="SVG" /><category term="Expression Blend" /><category term="Math" /><category term="Windows" /><category term="Flash Media Live Encoder" /><category term="Molehill" /><category term="Interaction" /><category term="DisplayObject" /><category term="NEWS" /><category term="RIA" /><category term="OSMF" /><category term="Rendering" /><category term="Graphics" /><category term="Camera" /><category term="swfObject" /><category term="AS2" /><category term="SharedObject" /><category term="Flex" /><category term="Loader" /><category term="SyntaxHighlighter" /><category term="Video" /><category term="Threading" /><category term="Undocumented" /><category term="Dictionary" /><category term="Codec" /><category term="CSS" /><category term="Reparenting" /><category term="Frame-Script" /><category term="Swiffy" /><category term="Opera" /><category term="Photography" /><category term="Theme" /><category term="LiveCycle" /><category term="Namespace" /><category term="Tween" /><category term="Cairngorm" /><category term="Firefox" /><category term="Array" /><category term="Layout" /><category term="Tip" /><category term="Flash-Media-Server" /><category term="Scale-9" /><category term="Sound" /><category term="Eclipse" /><category term="Widget" /><category term="QName" /><category term="SecureSWF" /><category term="ViewStack" /><category term="Illustrator" /><category term="Global" /><category term="Skin" /><category term="Python" /><category term="DividedBox" /><category term="Cache" /><category term="Proxy-Object" /><category term="Memory-Leak" /><category term="ActionScript" /><category term="DataGrid" /><category term="ByteArray" /><category term="SWF" /><category term="Puzzle" /><category term="Keyboard" /><category term="PureMVC" /><category term="GUI" /><category term="Cross-Domain" /><category term="Chrome" /><category term="Adobe-AIR" /><category term="User-Interface" /><category term="hitArea" /><category term="BitmapData" /><category term="Multi-Languages" /><category term="Health" /><category term="Flash-CS3" /><category term="Spark" /><category term="TextEngine" /><category term="Localization" /><category term="Event-Listener" /><category term="Data-Binding" /><category term="TileList" /><category term="UnityScript" /><category term="Flash-Player" /><category term="CD-Title" /><category term="Google" /><category term="Physics-Engine" /><category term="FrameLabel" /><category term="Package" /><category term="CSS3" /><category term="Linux" /><category term="Box2D" /><category term="Function-Closure" /><category term="Tools" /><category term="Document-Class" /><category term="Qt4" /><category term="Flash-CS4" /><category term="FlashLite" /><category term="Ant" /><category term="jsfl" /><category term="scrollRect" /><category term="Silverlight" /><category term="Clutter" /><category term="WebService" /><category term="ApplicationDomain" /><category term="NetStream" /><category term="Kaspersky" /><category term="Weak-Reference" /><category term="Flex-Hero" /><category term="Flash-Builder-4.5" /><category term="Prototype-Function" /><category term="IE9" /><category term="Model" /><category term="Flex-4-Gumbo" /><category term="CSS2" /><category term="Unity3D" /><category term="BlendMode" /><category term="WebKit" /><category term="Focus" /><category term="Object-Comparison" /><category term="XAML" /><category term="HTTP" /><category term="Photoshop" /><category term="URL-Encoding" /><category term="NumericStepper" /><category term="Flash" /><category term="Community" /><category term="Stream-Server" /><category term="ActiveX" /><category term="Safari" /><category term="List" /><category term="Error" /><category term="Decompile" /><category term="Adobe" /><category term="jQuery" /><category term="ExternalInterface" /><category term="Oddity" /><category term="Flash-Catalyst" /><category term="Xuite" /><category term="XML" /><category term="Blogger" /><category term="Dreamweaver" /><category term="NetConnection" /><category term="Drag-and-Drop" /><category term="Timeline" /><category term="Assembler" /><category term="Filter" /><category term="Mouse" /><category term="Tree" /><category term="Socket" /><category term="Strict-Mode" /><category term="HTML" /><category term="Debug" /><category term="JavaScript" /><category term="Gecko" /><category term="FrameRate" /><category term="Preloader" /><category term="Trick" /><category term="Usability" /><category term="Silverlight-3" /><category term="Capabilities" /><category term="ByteCode" /><category term="Technology" /><category term="Design-Pattern" /><category term="Flash-Remoting" /><category term="RobotLegs" /><category term="XUL" /><category term="Compress" /><category term="E4X" /><category term="MovieClip" /><category term="Security" /><category term="Ajax" /><category term="Programming" /><category term="Font" /><category term="GTK" /><category term="C++" /><category term="Transparent" /><category term="Module" /><category term="Alchemy" /><category term="Input-Method" /><category term="AGAL" /><category term="Mashup" /><category term="dHTML" /><category term="Flash-CS5.5" /><category term="RSL" /><category term="Event-Flow" /><category term="Conference" /><category term="AVM1Movie" /><category term="UIMovieClip" /><category term="ContextMenu" /><category term="Documents" /><category term="Animation" /><category term="Style" /><category term="HTML5" /><category term="Windows 7" /><category term="LocalConnection" /><category term="Menu" /><category term="Mobile" /><category term="Pixel-Bender" /><category term="AS3" /><category term="Java" /><category term="Away3D" /><category term="PV3D" /><category term="Algorithm" /><category term="LoadVars" /><category term="Firebug" /><category term="RegExp" /><category term="3D" /><category term="Transition-Effect" /><category term="FPS" /><category term="Charset" /><category term="Embed" /><category term="UIComponent" /><category term="MXML" /><category term="GC" /><category term="Mask" /><category term="IE" /><category term="ClearType" /><category term="TLF" /><category term="Scope-Chain" /><category term="Red5" /><category term="Flash-CS5" /><category term="Books" /><title>Ticore's Blog</title><subtitle type="html">Flash、Flex、AIR、ActionScript 相關研究心得</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://ticore.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>617</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/TicoresBlog" /><feedburner:info uri="ticoresblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CUYHSH4_fip7ImA9WhRXEkQ.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-7201975683681962318</id><published>2011-12-19T13:55:00.002+08:00</published><updated>2011-12-19T19:12:19.046+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-19T19:12:19.046+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="3D" /><category scheme="http://www.blogger.com/atom/ns#" term="Oddity" /><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="Unity3D" /><category scheme="http://www.blogger.com/atom/ns#" term="UnityScript" /><title>UnityScript 語言特性測試</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/7201975683681962318/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=7201975683681962318" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/7201975683681962318?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/7201975683681962318?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/ZuzFgesv_io/unityscript-test.html" title="UnityScript 語言特性測試" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>0</thr:total><content type="html">Ticore's Blog

前一陣子開始稍微測試 Unity3D 的程式語法
可以同時使用 C#, Javascript (UnityScript), Boo Script 三種語言開發
官方推薦的語言是 Javascript，所以先從它開始測試
雖然它也叫做 Javascript，但是跟你想的 Javascript 絕對不一樣
稱作 UnityScript 還比較合適
測試之後，發現有很多的問題與特殊語法
以下做個筆記




一般來說 UnityScript 特性如下：



UnityScript 沒有 undefined，只有 null，未定義字串變數為 null
UnityScript 不支援 function arguments
UnityScript 不支援 prototype 原型鍊
UnityScript 不支援 literal regular expression

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nQIsLnwbqB4SFftDJWVU0JXhAaE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nQIsLnwbqB4SFftDJWVU0JXhAaE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nQIsLnwbqB4SFftDJWVU0JXhAaE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nQIsLnwbqB4SFftDJWVU0JXhAaE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/ZuzFgesv_io" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/12/unityscript-test.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQBRno_fCp7ImA9WhRQE0s.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-7305458298836615292</id><published>2011-12-09T00:26:00.001+08:00</published><updated>2011-12-09T00:39:17.444+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-09T00:39:17.444+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MXML" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Mobile" /><category scheme="http://www.blogger.com/atom/ns#" term="Adobe-AIR" /><category scheme="http://www.blogger.com/atom/ns#" term="Flex" /><title>Flex Mobile View Test</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/7305458298836615292/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=7305458298836615292" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/7305458298836615292?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/7305458298836615292?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/XJ6zLNkt7kY/flex-mobile-view-test.html" title="Flex Mobile View Test" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-guWk7h1tmWY/TuDoDb2vu3I/AAAAAAAAKQg/zhtNL8dZM2s/s72-c/FlexViewNavigatorTest.png" height="72" width="72" /><thr:total>0</thr:total><content type="html">Ticore's Blog

看到網路上有人問 Flex Mobile View 的問題
基於以前開發 Flex App 經驗順便測試一下
Flex Mobile View 設計概念與 Desktop App 很不一樣
可以參考這篇文章介紹
Understanding Flex Mobile View and ViewNavigator
以及官方規格文件
Hero View &amp;amp; ViewNavigator - Functional and Design Specification



以下簡單例子 ViewNavigatorApplication 包含三個子 View - FirstView, SecondView, ThirdView
全部都共享一份 Data，直接使用 ObjectProxy 來做
這樣可以很容易利用 Data Binding
Data 內存放三個主要資料 txt1
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YHvx9IWGytJ3B3hVoGABeimPtrA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YHvx9IWGytJ3B3hVoGABeimPtrA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YHvx9IWGytJ3B3hVoGABeimPtrA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YHvx9IWGytJ3B3hVoGABeimPtrA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/XJ6zLNkt7kY" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/12/flex-mobile-view-test.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkAARn0_fyp7ImA9WhRRGE8.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-6039211511118499802</id><published>2011-12-02T17:58:00.001+08:00</published><updated>2011-12-02T18:12:27.347+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-02T18:12:27.347+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Security" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Module" /><category scheme="http://www.blogger.com/atom/ns#" term="Flex" /><title>Flex SDK Security Update</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/6039211511118499802/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=6039211511118499802" title="2 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/6039211511118499802?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/6039211511118499802?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/W-gSaWHYNUs/flex-sdk-security-update.html" title="Flex SDK Security Update" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>2</thr:total><content type="html">Ticore's Blog

昨天突然看到 Flex SDK 居然大幅度發布安全性更新
不是都要捐給 Apache 了嗎?
從 3.0.0 一路到 4.5.1 全部都有更新
而最新的 4.6 則不受影響，可以參考以下文章



Security update available for Adobe Flex SDK (APSB11-25)
Flex Security Issue APSB11-25


只要版號後面加上 A 的都是安全更新過的，e.g. Flex 4.5.1.21328A
另外 Adobe 也提供了補救工具 APSB11_25_Patch_Tool.air
可以直接對既有的 SWF 進行偵測並修復
詳細使用請參考上面連結說明


很好奇動作這麼大，到底是什麼樣的漏洞?
根據文件說明找了原始碼 mx.modules.ModuleManager.as
內的 inner 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/myjMfxOTZaP8lP05TxjKyj99n0c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/myjMfxOTZaP8lP05TxjKyj99n0c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/myjMfxOTZaP8lP05TxjKyj99n0c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/myjMfxOTZaP8lP05TxjKyj99n0c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/W-gSaWHYNUs" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/12/flex-sdk-security-update.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EBQX46eSp7ImA9WhRRFEk.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-3020624384814599918</id><published>2011-11-28T10:27:00.001+08:00</published><updated>2011-11-28T11:07:30.011+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-28T11:07:30.011+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tip" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash-Builder-4.5" /><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="Flex" /><title>根除 FB 4.5 預設的 Workspace</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/3020624384814599918/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=3020624384814599918" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/3020624384814599918?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/3020624384814599918?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/OPCsgn6HZ-0/eliminate-fb-45-default-workspace.html" title="根除 FB 4.5 預設的 Workspace" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>0</thr:total><content type="html">Ticore's Blog

使用 Flash Builder 時，第一次啟動都會在 User Folder 下建立預設 workspace
e.g. C:\Users\Ticore\Adobe Flash Builder 4.5
以前的版本，只要切換到自己的 worksapce 之後，砍掉預設的即可
可是 FB 4.5 行為改變了，預設 workspace 不能砍掉
就算砍掉，每次啟動自動重建，而且關於 workspaces 歷史紀錄與相關設定也會存放在那



看了覺得很討厭，於是想辦法根除 FB 4.5 預設 worksapce
Flash Builder 是基於 Eclipse 改出來的，可以搜尋 Eclipse 相關的設定
The Eclipse runtime options


發現 FB 4.5 內的 config.ini 決定預設 workspace 與 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XR3yjtBcYuxohRXQyOlvc2x_xMI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XR3yjtBcYuxohRXQyOlvc2x_xMI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XR3yjtBcYuxohRXQyOlvc2x_xMI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XR3yjtBcYuxohRXQyOlvc2x_xMI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/OPCsgn6HZ-0" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/11/eliminate-fb-45-default-workspace.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YHRngzeip7ImA9WhRSGUU.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-6054472185274211075</id><published>2011-11-23T00:37:00.001+08:00</published><updated>2011-11-23T00:58:57.682+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-23T00:58:57.682+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Swiffy" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Debug" /><category scheme="http://www.blogger.com/atom/ns#" term="AS1" /><category scheme="http://www.blogger.com/atom/ns#" term="Trick" /><category scheme="http://www.blogger.com/atom/ns#" term="AS2" /><title>Hack Swiffy Runtime</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/6054472185274211075/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=6054472185274211075" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/6054472185274211075?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/6054472185274211075?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/RQ7dOHHWEe8/hack-swiffy-runtime.html" title="Hack Swiffy Runtime" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-uXmvTGwrWrk/TsvSfWY615I/AAAAAAAAKNU/afTVNkXnW7Q/s72-c/HackSwiffyRuntime01.png" height="72" width="72" /><thr:total>0</thr:total><content type="html">Ticore's Blog

由於 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 (
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/prVU8W21nPxsR8HBiuVYKF0BDws/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/prVU8W21nPxsR8HBiuVYKF0BDws/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/prVU8W21nPxsR8HBiuVYKF0BDws/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/prVU8W21nPxsR8HBiuVYKF0BDws/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/RQ7dOHHWEe8" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/11/hack-swiffy-runtime.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIDSH06fyp7ImA9WhRSGUo.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-1578632132275748753</id><published>2011-11-22T10:25:00.001+08:00</published><updated>2011-11-22T23:42:59.317+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-22T23:42:59.317+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Swiffy" /><category scheme="http://www.blogger.com/atom/ns#" term="SWF" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="HTML5" /><category scheme="http://www.blogger.com/atom/ns#" term="AS1" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash" /><category scheme="http://www.blogger.com/atom/ns#" term="AS2" /><title>測試 Google Swiffy 轉換工具</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/1578632132275748753/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=1578632132275748753" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/1578632132275748753?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/1578632132275748753?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/_ee55z_UxMQ/google-swiffy-swf-to-html5.html" title="測試 Google Swiffy 轉換工具" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-QLTPk0ftZHw/TssK_uf0ANI/AAAAAAAAKMo/QKnJFovko7I/s72-c/SWFArrow9.png" height="72" width="72" /><thr:total>0</thr:total><content type="html">Ticore's Blog

最近 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 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VtwEp7XNFHUJF3setkq1c4CMJ3M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VtwEp7XNFHUJF3setkq1c4CMJ3M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VtwEp7XNFHUJF3setkq1c4CMJ3M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VtwEp7XNFHUJF3setkq1c4CMJ3M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/_ee55z_UxMQ" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/11/google-swiffy-swf-to-html5.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QHRnszeip7ImA9WhRSFks.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-8063247823490583384</id><published>2011-11-19T10:15:00.001+08:00</published><updated>2011-11-19T10:22:17.582+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-19T10:22:17.582+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tip" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Sound" /><title>解決 Mp3 循環音效停頓的問題</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/8063247823490583384/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=8063247823490583384" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/8063247823490583384?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/8063247823490583384?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/wzO6qxvUfTQ/remove-mp3-loop-gap.html" title="解決 Mp3 循環音效停頓的問題" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-bL_MMZt2z4M/TscS1fcZ8ZI/AAAAAAAAKLk/iCyeojHmzUg/s72-c/Mp3Gap.png" height="72" width="72" /><thr:total>0</thr:total><content type="html">Ticore's Blog

最近在處理 Mp3 Loop 音效時，發現不管怎樣拿到的檔案
播放起來總是會有一個停頓
因為這個 Loop 很短，撥放越快停頓就越明顯









上網查了一下資料，原來幾乎所有的 Mp3 Encoder 都會在前面加上一點點的空白


gap in mp3 loops, how to avoid it ?
Seamless looping MP3 sound (or silent gap glitch)?
Andre Michelle - Playback MP3-Loop (gapless)


繞道方式很簡單，不要用 Mp3 改用 Wave 匯入到 Flash 做就好了
或者用 AS 去掉前面的空白
另外，網路上也有人提供小工具，能夠將 Wave 轉成 Mp3 且不會產生空白


Gapless looping MP3 tracks


&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JRZr9VIa_pJWJHa6k0o4Ibd-AEc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JRZr9VIa_pJWJHa6k0o4Ibd-AEc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JRZr9VIa_pJWJHa6k0o4Ibd-AEc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JRZr9VIa_pJWJHa6k0o4Ibd-AEc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/wzO6qxvUfTQ" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/11/remove-mp3-loop-gap.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cBR3s9cCp7ImA9WhRSFUk.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-5408364080156898789</id><published>2011-11-17T21:22:00.001+08:00</published><updated>2011-11-17T23:50:56.568+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-17T23:50:56.568+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash" /><category scheme="http://www.blogger.com/atom/ns#" term="Sound" /><title>AS3 可任意調整速度的聲音撥放器</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/5408364080156898789/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=5408364080156898789" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/5408364080156898789?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/5408364080156898789?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/vTDAhbYMsyU/as3-variable-speed-sound.html" title="AS3 可任意調整速度的聲音撥放器" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>0</thr:total><content type="html">Ticore's Blog

因為需要製作遊戲內轉動聲音效果，可是轉動速度是會變化的
假如只是拿一般音效直接撥放，聽起來會很假對不起來
於是想到 AS3 已經有支援 Audio Programming 功能
網路上已經有不少分享的例子與介紹
ByteArray.org - Rendering spectrums with Sound.extract
kelvinluck.com - First steps with flash 10 audio programming
kelvinluck.com - Second steps with Flash 10 audio programming
Sonoport - Dynamic AS3 Sound Component Library for Flash and Flex
milkmidi Blog - AS3 Scratch




&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4sXnLxuR37MaqWBuVXZDddu2yQo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4sXnLxuR37MaqWBuVXZDddu2yQo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4sXnLxuR37MaqWBuVXZDddu2yQo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4sXnLxuR37MaqWBuVXZDddu2yQo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/vTDAhbYMsyU" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/11/as3-variable-speed-sound.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEAGQ3k6eip7ImA9WhRTE0o.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-5936961184609099510</id><published>2011-11-04T10:10:00.002+08:00</published><updated>2011-11-04T10:12:02.712+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-04T10:12:02.712+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MXML" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Mouse" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Flex" /><category scheme="http://www.blogger.com/atom/ns#" term="Trick" /><title>自訂 Flex 滑鼠游標實體</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/5936961184609099510/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=5936961184609099510" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/5936961184609099510?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/5936961184609099510?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/spTT1CxsllY/custom-flex-cursor-instance.html" title="自訂 Flex 滑鼠游標實體" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>0</thr:total><content type="html">Ticore's Blog

遇到一個問題是，想要自訂 Flex App 的 Cursor 可是又要能存取 Cursor 實體
以便做其他的動態控制
可是 Flex CursorManager 基本上是不允許這樣做的
只能以 Class 方式設定 Cursor，也無法存取到目前 Cursor 實體
網路上有人提過解決方式 Jesse Warden - Making a Cooler Cursor in Flex
可是他是藉由 Hack CursorManager 方式做到
實際用 Flex 4.5 測試，發現只要將編譯模式從 Merged into code 改為 RSL
這個方法就失效了，只好自行另外想辦法



觀察 StyleManager 實作，發現 Cursor 實體是放在 systemManager.cursorChildren &amp;gt; cursorHolder 內

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/GPU5t2JIzjVT3ydqtvKOgEy7EUI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GPU5t2JIzjVT3ydqtvKOgEy7EUI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/GPU5t2JIzjVT3ydqtvKOgEy7EUI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GPU5t2JIzjVT3ydqtvKOgEy7EUI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/spTT1CxsllY" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/11/custom-flex-cursor-instance.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UDSHs6eCp7ImA9WhRTEk8.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-7951921798775685219</id><published>2011-11-02T18:17:00.000+08:00</published><updated>2011-11-02T18:21:19.510+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-02T18:21:19.510+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oddity" /><category scheme="http://www.blogger.com/atom/ns#" term="MXML" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Module" /><category scheme="http://www.blogger.com/atom/ns#" term="Flex" /><category scheme="http://www.blogger.com/atom/ns#" term="ApplicationDomain" /><title>Flex App 直接引用外部 Module 的問題</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/7951921798775685219/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=7951921798775685219" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/7951921798775685219?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/7951921798775685219?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/mUW-HoQ897Y/direct-referenced-module-issue.html" title="Flex App 直接引用外部 Module 的問題" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-TFuTlbtNQ-w/TrEXdNvdIwI/AAAAAAAAKDM/nmnxBVzTGsQ/s72-c/DirectRefModuleIssue.png" height="72" width="72" /><thr:total>0</thr:total><content type="html">Ticore's Blog

最近同事遇到一個 Flex 問題，只要 Module 內放了其它組件
執行就會出現各種奇怪 Error
後來發現是因為在 Main Application 直接引用編譯到 Module Class
然後又企圖用 ModuleLoader 再載入一次相同的 Module SWF
當然這樣做是錯誤的範例，Flash Builder 也會給予警告






Warning: Mod is a module or application that is directly referenced.
This will cause Mod and all of its dependencies to be linked in with MainApp.
Using an interface is the recommended practice to avoid 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FM96H4szD6Z5ZZeGcC1z8xygZ5w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FM96H4szD6Z5ZZeGcC1z8xygZ5w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FM96H4szD6Z5ZZeGcC1z8xygZ5w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FM96H4szD6Z5ZZeGcC1z8xygZ5w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/mUW-HoQ897Y" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/11/direct-referenced-module-issue.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4NRXc7cCp7ImA9WhRTEUw.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-482042730756134597</id><published>2011-11-01T10:53:00.003+08:00</published><updated>2011-11-01T11:09:54.908+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-01T11:09:54.908+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Array" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><title>AS3 Cross Join Function</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/482042730756134597/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=482042730756134597" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/482042730756134597?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/482042730756134597?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/Ymd5kNloy10/as3-cross-join-function.html" title="AS3 Cross Join Function" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>0</thr:total><content type="html">Ticore's Blog

昨天想要用各種不同條件測試 Flash AS3 的畫線
用過 graphics.lineStyle 應該知道參數很多種
但總不可能把各種條件組合通通打出來測試
就算用一般 Loop 方式，也要寫到四~五層 Loop
於是想要寫一個類似 SQL Cross Join 的 function
可以傳入不定數量的資料，將所有排列組合結果找出來



一開始寫時候，大約用了十來行
不斷改進之後，程式碼比想像中少很多
而且連一個區域變數都沒宣告
用了三層 Loop 完成


以下便是 AS3 Cross Join 公用函式：


package com.ticore.utils {
 /**
  * 排列組合公用函式，可以對傳入的二維參數陣列
  * 找出各種組合，並將結果陣列回傳
  * 
  * @param args 任意數量的二維參數陣列
  * @param 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QFX1Ckr5BsTcjj841KWfeauFsBI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QFX1Ckr5BsTcjj841KWfeauFsBI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QFX1Ckr5BsTcjj841KWfeauFsBI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QFX1Ckr5BsTcjj841KWfeauFsBI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/Ymd5kNloy10" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/11/as3-cross-join-function.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIDQnk_fyp7ImA9WhdaGU0.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-6071005213994121504</id><published>2011-10-29T19:38:00.002+08:00</published><updated>2011-10-29T23:52:53.747+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-29T23:52:53.747+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MXML" /><category scheme="http://www.blogger.com/atom/ns#" term="Embed" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Skin" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Flex" /><category scheme="http://www.blogger.com/atom/ns#" term="UIMovieClip" /><category scheme="http://www.blogger.com/atom/ns#" term="Trick" /><category scheme="http://www.blogger.com/atom/ns#" term="Spark" /><title>MovieClip as Spark Skin</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/6071005213994121504/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=6071005213994121504" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/6071005213994121504?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/6071005213994121504?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/GQko5-7C-2k/movieclip-as-spark-skin.html" title="MovieClip as Spark Skin" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-dEjJVmcs5XQ/TqvjNz7EcjI/AAAAAAAAKCY/VJNIp5Wiw9k/s72-c/UIMovieClipTimeline.png" height="72" width="72" /><thr:total>0</thr:total><content type="html">Ticore's Blog

自從 Flex 開發專案升級到 4.5 Spark Component 後
新的 Advanced State Syntax, Skinning 功能增加不少彈性，很多簡單的圖形也不一定需要用 Flash 做
直接用幾個 MXML Graphics 標籤就能完成
但是有些情況，還是用到 Flash 做比較方便
譬如 Shape Tween 之類的
這時候該如何將 Flash MovieClip 與 Flex Spark Skin 整合在一起呢?



目前想到最方便的做法仍是利用 UIMovieClip
如同上次介紹的方式 Flash Stateful MovieClip
拉好時間軸動畫，下好 Frame Label






接下來輸出 SWF，然後用以下方式嵌入到 Spark Skin MXML


&amp;lt;?xml version="1.0" 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bCBe_AhxynKzAqCscz3hIXB0flU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bCBe_AhxynKzAqCscz3hIXB0flU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bCBe_AhxynKzAqCscz3hIXB0flU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bCBe_AhxynKzAqCscz3hIXB0flU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/GQko5-7C-2k" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/10/movieclip-as-spark-skin.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIDQ3YzfSp7ImA9WhdaE0k.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-6298487795351127557</id><published>2011-10-20T12:09:00.001+08:00</published><updated>2011-10-23T12:19:32.885+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-23T12:19:32.885+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Bug" /><category scheme="http://www.blogger.com/atom/ns#" term="RobotLegs" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Module" /><category scheme="http://www.blogger.com/atom/ns#" term="Flex" /><category scheme="http://www.blogger.com/atom/ns#" term="ApplicationDomain" /><title>RobotLegs Module 開發上的問題</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/6298487795351127557/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=6298487795351127557" title="7 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/6298487795351127557?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/6298487795351127557?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/_Km1pUKAD2U/robotlegs-module-issue.html" title="RobotLegs Module 開發上的問題" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>7</thr:total><content type="html">Ticore's Blog

最近開始使用 RobotLegs，覺得還蠻好用的，可以少寫很多程式碼
雖然有一些效能上的問題，但可以透過自己管理創建/銷毀時機方式避開


當想要把它用在 Flex Module 開發時，又遇到了一些問題
找不到任何良好的 RobotLegs Modular 開發範例
雖然有人寫了 Modular Utilities，且有提供範例 ModularDoodads
但是坦白說，寫的很糟糕
Module 與主程式綁在一起，無法拆成獨立外部檔案



又有人基於 Modular Utilities 寫了另一個範例 DynModules
終於將 Module 拆成外部檔案了
不過仔細一看，原來它 Hard Code 硬將 Module 載入到 ApplicationDomain.currentDomain
表示 Module 永遠無法卸載，又是另一個骯髒的範例

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/alVKt-ogn1p4AqODyj03F0xS7Ho/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/alVKt-ogn1p4AqODyj03F0xS7Ho/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/alVKt-ogn1p4AqODyj03F0xS7Ho/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/alVKt-ogn1p4AqODyj03F0xS7Ho/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/_Km1pUKAD2U" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/10/robotlegs-module-issue.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMGSHs5cSp7ImA9WhdaEUo.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-8817891500065576248</id><published>2011-10-19T14:27:00.001+08:00</published><updated>2011-10-21T13:20:29.529+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-21T13:20:29.529+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oddity" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="SecureSWF" /><category scheme="http://www.blogger.com/atom/ns#" term="ApplicationDomain" /><title>SecureSWF 與外部模組的陷阱</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/8817891500065576248/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=8817891500065576248" title="2 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/8817891500065576248?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/8817891500065576248?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/HQwjFfDhJMk/secureswf-sub-appdomain-issue.html" title="SecureSWF 與外部模組的陷阱" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>2</thr:total><content type="html">Ticore's Blog

使用 SecureSWF 做包含外部模組的專案時，遇到混淆過頭
導致外部 SWF 模組無法正常執行的問題
當然基本的共用類別需要必須先排除在外
可是還是無法正常執行
測試簡化問題之後，發生條件如下



主程式 SWF 包含一共享父類別定義
該類別宣告了 protected getter/setter member
且型別是一個 interface
外部子 SWF 模組繼承此共享父類別


當兩個 SWF 混淆過之後 (排除共享父類別)
外部子 SWF 模組載入後，嘗試存取 super protected member
會得到 ReferenceError: Error #1065: 變數 default::foo 未定義。
以下是測試原始碼：



Main.as


package {
 import com.ticore.obfu.SupClass;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/o9hJGBY2HK4UBkieos_idYRHct0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/o9hJGBY2HK4UBkieos_idYRHct0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/o9hJGBY2HK4UBkieos_idYRHct0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/o9hJGBY2HK4UBkieos_idYRHct0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/HQwjFfDhJMk" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/10/secureswf-sub-appdomain-issue.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkEDSHgzfip7ImA9WhRSEEQ.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-473261872511774052</id><published>2011-10-12T20:15:00.001+08:00</published><updated>2011-11-12T17:37:59.686+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-12T17:37:59.686+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Array" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash-Player" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Bug" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><title>Flash Player 11 Array Bug</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/473261872511774052/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=473261872511774052" title="1 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/473261872511774052?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/473261872511774052?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/o1LNjRbKLY4/flash-player-11-array-bug.html" title="Flash Player 11 Array Bug" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>1</thr:total><content type="html">Ticore's Blog

最近 Flash Player 11 正式版發表不久
網友 Vincent 留言發現空 Array 的 splice 操作會出現問題
測試程式如下






package {
 import flash.display.Sprite;
 import flash.system.Capabilities;
 import flash.text.TextField;

 [SWF(width="300", height="200")]
 public class FL11ArrayIssue extends Sprite {
  
  public function FL11ArrayIssue() {
   trace(Capabilities.version, Capabilities.playerType);
   
   var ary:Array 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/d3YcpqLwWZB7Fljm-HMjqb7yndc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/d3YcpqLwWZB7Fljm-HMjqb7yndc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/d3YcpqLwWZB7Fljm-HMjqb7yndc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/d3YcpqLwWZB7Fljm-HMjqb7yndc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/o1LNjRbKLY4" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/10/flash-player-11-array-bug.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YDQXgyeCp7ImA9WhdUFUQ.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-4650670433399100603</id><published>2011-09-27T21:21:00.001+08:00</published><updated>2011-10-03T06:39:30.690+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-03T06:39:30.690+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash-Player" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Bug" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="RegExp" /><title>AS3 String Trim</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/4650670433399100603/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=4650670433399100603" title="6 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/4650670433399100603?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/4650670433399100603?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/I4H1uAK9llU/as3-string-trim.html" title="AS3 String Trim" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>6</thr:total><content type="html">Ticore's Blog

臨時需要用到 String Trim 功能，上網找了一下
最好用的方式還是 Regular Expression，還蠻多版本的
但是實際測試之後發現大多都有一些小問題



http://jeffchannell.com/ActionScript-3/as3-trim.html
http://snipplr.com/view/34129/
http://hi.baidu.com/%F1%B2%BF%F1%CE%C3%D7%D3/blog/item/8e5488b5d672f7c837d3ca6b.html
http://stackoverflow.com/questions/2909950/trimming-strings-with-actionscript-3


實際測試程式如下：


var s:String = " \r　\n \t 1\t2 3 \
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/C0I3DEqC_gUV6-EtwN3zjzEj2PM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/C0I3DEqC_gUV6-EtwN3zjzEj2PM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/C0I3DEqC_gUV6-EtwN3zjzEj2PM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/C0I3DEqC_gUV6-EtwN3zjzEj2PM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/I4H1uAK9llU" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/09/as3-string-trim.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMNRHw9eyp7ImA9WhdVGEs.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-2693139742729913363</id><published>2011-09-24T18:31:00.002+08:00</published><updated>2011-09-24T18:34:55.263+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-24T18:34:55.263+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Flash-Player" /><category scheme="http://www.blogger.com/atom/ns#" term="SWF" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Font" /><category scheme="http://www.blogger.com/atom/ns#" term="Bug" /><category scheme="http://www.blogger.com/atom/ns#" term="TextField" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><title>Flash Player 10.2, 10.3 TextField 中文字體問題</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/2693139742729913363/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=2693139742729913363" title="2 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/2693139742729913363?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/2693139742729913363?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/WPF40H1zQZE/fp-102-103-textfield-font-issue.html" title="Flash Player 10.2, 10.3 TextField 中文字體問題" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>2</thr:total><content type="html">Ticore's Blog

我是 Ticore，論壇上看有人問 Flash CS5.5 用 AS3 建立的 TextField 無法動態設置中文字體
實際測試之後，發現並不是 Flash IDE 的問題
而是 Flash Player 10.2, 10.3 且當 swf version 為 11, 12 時，TextField 用中文名稱設定字型失效
測試程式碼如下：




package {
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFormat;

	[SWF(width="300", height="200")]
	public class Main extends Sprite {

		public function Main() {
			var 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/n0OqalJi-mymS_qHkcxa7G1hC7o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/n0OqalJi-mymS_qHkcxa7G1hC7o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/n0OqalJi-mymS_qHkcxa7G1hC7o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/n0OqalJi-mymS_qHkcxa7G1hC7o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/WPF40H1zQZE" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/09/fp-102-103-textfield-font-issue.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMGQn4-cCp7ImA9WhdVFko.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-2740718374795001333</id><published>2011-09-22T10:14:00.001+08:00</published><updated>2011-09-22T14:20:23.058+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-22T14:20:23.058+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="CSS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Font" /><category scheme="http://www.blogger.com/atom/ns#" term="CSS" /><category scheme="http://www.blogger.com/atom/ns#" term="Trick" /><category scheme="http://www.blogger.com/atom/ns#" term="HTML" /><title>改善微軟正黑體無 Clear Type 下表現</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/2740718374795001333/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=2740718374795001333" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/2740718374795001333?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/2740718374795001333?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/dm5rRE9cAGA/ms-jhenghei-no-clear-type-fix.html" title="改善微軟正黑體無 Clear Type 下表現" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-qnkEFqsyQFo/TnqZebYVnzI/AAAAAAAAJP8/LX_CUxQmxNE/s72-c/ChromeClearType.png" height="72" width="72" /><thr:total>0</thr:total><content type="html">Ticore's Blog

看到阿拉丁在 FB 上提到，網頁字形指定為微軟正黑體
假如客戶電腦上又沒有打開 ClearType 功能時
文字會變得很難看，而唯一解法只有偵測 ClearType 是否打開
否則不要使用微軟正黑體


想到之前測試 CSS3 text-shadow 功能或許會有幫助
實際測試之後，發現果然改善不少
以下是測試 HTML 原始碼：






&amp;lt;!DOCTYPE HTML&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta charset="utf-8"&amp;gt;
&amp;lt;title&amp;gt;微軟正黑體 w/o ClearType&amp;lt;/title&amp;gt;
&amp;lt;style type="text/css"&amp;gt;
body {
	font-size: 1em;
}
.style1 {
	color: #000;
	font-family: 微軟正黑體;
}
.style2 {
	color: #000;
	
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fbuEgawBU-IB5yEHbdPhYKN1fE8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fbuEgawBU-IB5yEHbdPhYKN1fE8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fbuEgawBU-IB5yEHbdPhYKN1fE8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fbuEgawBU-IB5yEHbdPhYKN1fE8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/dm5rRE9cAGA" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/09/ms-jhenghei-no-clear-type-fix.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UHRHY8fCp7ImA9WhdVE0k.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-2224961641095039842</id><published>2011-09-18T18:06:00.001+08:00</published><updated>2011-09-18T18:20:35.874+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-18T18:20:35.874+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Filter" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Pixel-Bender" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash" /><title>Flash 抽色效果濾鏡</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/2224961641095039842/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=2224961641095039842" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/2224961641095039842?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/2224961641095039842?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/G29DPaquwpA/partial-color-shader.html" title="Flash 抽色效果濾鏡" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-FQBD-KK_HzY/TnXCJhCylnI/AAAAAAAAJJA/bBJDaUh9zLo/s72-c/DSCN0140.jpg" height="72" width="72" /><thr:total>0</thr:total><content type="html">Ticore's Blog

我是 Ticore，這次要分享的是用 Pixel Bender 做出來的抽色濾鏡效果
可以依據指定的色彩，調整點陣圖的色彩飽和度
色彩相差越遠的飽和度越低
效果看起來就會像是把特定色彩抽出來了一樣



直接從 RGB 數值去思考會覺得非常難做
其實只要把 RGB 轉為 HSV 色彩模式便簡單許多
拿到 Hue 值之後，便能拿來與設定主色色彩做比較
差越遠的，就把飽和度調得越低
以下便是我自製的 Partial Color Shader 原始碼：


&amp;lt;languageVersion : 1.0;&amp;gt;
kernel PartialColor
&amp;lt;
    namespace : "PartialColor";
    vendor : "Ticore Shih";
    version : 1;
    description : "only keep 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wGcoCCZRSFQkPkQPLHphGoRZKYk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wGcoCCZRSFQkPkQPLHphGoRZKYk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wGcoCCZRSFQkPkQPLHphGoRZKYk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wGcoCCZRSFQkPkQPLHphGoRZKYk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/G29DPaquwpA" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/09/partial-color-shader.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUBQ3Y_fyp7ImA9WhdaGEU.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-6384777720775369572</id><published>2011-09-14T10:04:00.001+08:00</published><updated>2011-10-29T19:04:12.847+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-29T19:04:12.847+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Flex-4-Gumbo" /><category scheme="http://www.blogger.com/atom/ns#" term="MXML" /><category scheme="http://www.blogger.com/atom/ns#" term="DataGrid" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Spark" /><title>Spark 多重欄位排序的 DataGrid</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/6384777720775369572/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=6384777720775369572" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/6384777720775369572?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/6384777720775369572?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/ySn82PeaMUM/spark-multi-column-sortable-datagrid.html" title="Spark 多重欄位排序的 DataGrid" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>0</thr:total><content type="html">Ticore's Blog

Flex 4.5 Spark 雖然提供了 DataGrid
可是它沒有像 mx:AdvancedDataGrid 那樣支援多 Column 排序功能
看到 Adobe Cookbooks - How do I perform a multicolumn sort in a Spark DataGrid?
有人提供，可是那幾乎是寫死在組件外部
不能讓 User 自己選擇排序欄位
所以我想辦法繼承 Spark DataGrid，複寫 columnHeaderGroup_clickHandler 函式
當 User 在 Column Header 同時按下 Ctrl + Mouse Left Click 時
提供多重 Column 排序的功能



MultiColSortableDataGrid.as

package {
	import 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2gPyHyORZ0LaX8hGgkZ-Oz94SvE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2gPyHyORZ0LaX8hGgkZ-Oz94SvE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2gPyHyORZ0LaX8hGgkZ-Oz94SvE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2gPyHyORZ0LaX8hGgkZ-Oz94SvE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/ySn82PeaMUM" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/09/spark-multi-column-sortable-datagrid.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMBRHY9eCp7ImA9WhdUEEg.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-4252112494288279421</id><published>2011-09-05T22:29:00.003+08:00</published><updated>2011-09-26T23:54:15.860+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-26T23:54:15.860+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Mask" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash-Player" /><category scheme="http://www.blogger.com/atom/ns#" term="Rendering" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Bug" /><category scheme="http://www.blogger.com/atom/ns#" term="AS1" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><title>巢狀遮罩造成 Flash Player 死機的 Bug</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/4252112494288279421/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=4252112494288279421" title="1 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/4252112494288279421?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/4252112494288279421?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/hf-Y2WhHMnE/nested-mask-crash-issue.html" title="巢狀遮罩造成 Flash Player 死機的 Bug" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>1</thr:total><content type="html">Ticore's Blog

我是 Ticore，已經好久沒有貼 Flash Player Crash Bug 了
今天突然又發現一個會造成 Flash Player 死機的問題
幾乎發生在所有 Flash Player 9, 10, 11 主要版本上
本來想回報到 Adobe Bug System 的
結果它把 Flash Player Project 關閉不讓我回報了
所以只好貼在 Blog 上
後來找到了是要在這裡回報 Flash Player



言歸正傳，這是關於巢狀遮罩的 Bug
由於一個 AS3 Mask 物件不能同時用在多個對象上
所以突發奇想，將主要 Mask 物件嵌套多層 Sprite
不同層的 Sprite 不就能夠用在多個對象上了嗎?


結果當然是失敗了，而且造成 Flash Player Crash 掉
以下是簡單的測試程式：


package {
	
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3pJz1BlClC3DrbY7VNFJz_m8Y28/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3pJz1BlClC3DrbY7VNFJz_m8Y28/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3pJz1BlClC3DrbY7VNFJz_m8Y28/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3pJz1BlClC3DrbY7VNFJz_m8Y28/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/hf-Y2WhHMnE" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/09/nested-mask-crash-issue.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAFQH4ycCp7ImA9WhdXFU0.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-8250594069519158966</id><published>2011-08-28T11:37:00.003+08:00</published><updated>2011-08-28T11:55:11.098+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-28T11:55:11.098+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Compiler" /><category scheme="http://www.blogger.com/atom/ns#" term="Embed" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Flex" /><category scheme="http://www.blogger.com/atom/ns#" term="Trick" /><title>Flex Compiler 編譯參數嵌入外部資源技巧</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/8250594069519158966/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=8250594069519158966" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/8250594069519158966?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/8250594069519158966?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/WNPWsNQSbAc/mxmlc-define-embed-source.html" title="Flex Compiler 編譯參數嵌入外部資源技巧" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>0</thr:total><content type="html">Ticore's Blog

大家好，我是 Ticore，這次來介紹關於 Flex Compiler 編譯參數與嵌入外部資源的技巧
看到有人問 Embed source 是否能使用變數
一般人直覺的反應大概都是不可能，因為 Embed 是編譯期就決定了
但是對於編譯期的變數呢? 測試之後發現是可行的



Flex Compiler - mxmlc 有支援定義變數的功能
最常見的是用來條件式編譯除錯
Stupid Flex MXMLC Compiler Tricks Part 1: Conditional Compiling


除了 Boolean 之外，它也是可以用來定義字串的
並且能夠指定到 Embed source 上
以下是完整的測試範例：


package {
	import flash.display.Sprite;

	
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oZ7QK93Q9bB_s8OwJFZTwJIzxzo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oZ7QK93Q9bB_s8OwJFZTwJIzxzo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oZ7QK93Q9bB_s8OwJFZTwJIzxzo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oZ7QK93Q9bB_s8OwJFZTwJIzxzo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/WNPWsNQSbAc" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/08/mxmlc-define-embed-source.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8CQ3Y6eCp7ImA9WhdXEEQ.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-1860004420807164806</id><published>2011-08-23T12:22:00.010+08:00</published><updated>2011-08-23T17:14:22.810+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-23T17:14:22.810+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Flex" /><category scheme="http://www.blogger.com/atom/ns#" term="UIMovieClip" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash" /><title>Flash Stateful MovieClip</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/1860004420807164806/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=1860004420807164806" title="2 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/1860004420807164806?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/1860004420807164806?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/5jlFJrjn2Yc/flash-stateful-movieclip.html" title="Flash Stateful MovieClip" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-vrOw_BrcrHc/TlMrxBuzdcI/AAAAAAAAI-o/PQGyc1HoA5s/s72-c/TransitionTimeline.png" height="72" width="72" /><thr:total>2</thr:total><content type="html">Ticore's Blog

一般需要製作 Flash 按鈕，最簡單的做法便是 SimpleButton
當需要增加 disabled 狀態或是漸變動畫效果時
大概又會改用 MovieClip 製作，在時間軸上加上漸變動畫與額外的狀態
並且添加自訂的影格控制程式
雖然 Flash 的時間軸功能很自由，可是隨著狀態與漸變越來越多
程式也會變得越來越複雜且難以管理



這時候突然想到之前在 Flex 相關書上看到的 UIMovieClip 時間軸功能
沒有碰過 Flex Skin 開發的人可能沒聽過 UIMovieClip
它主要是 Flash Flex 整合開發的橋接組件
讓開發者在 Flash 以時間軸繪圖方式製作，然後直接能夠拿到 Flex 內當作組件或是 Skin 使用


為什麼會提到這個，主要是因為它提供了超彈性的狀態轉換與時間軸播放的功能

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hfr6_i5iImXFtBZjlrBTPj5jHs4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hfr6_i5iImXFtBZjlrBTPj5jHs4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hfr6_i5iImXFtBZjlrBTPj5jHs4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hfr6_i5iImXFtBZjlrBTPj5jHs4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/5jlFJrjn2Yc" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/08/flash-stateful-movieclip.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcMQ3kzfip7ImA9WhdRGUQ.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-5920614025760759391</id><published>2011-08-06T09:55:00.017+08:00</published><updated>2011-08-10T23:28:02.786+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-10T23:28:02.786+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Flash-Player" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash-CS5.5" /><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash" /><category scheme="http://www.blogger.com/atom/ns#" term="Trick" /><title>如何更新 Flash CS5.5 內建除錯 Player</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/5920614025760759391/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=5920614025760759391" title="2 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/5920614025760759391?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/5920614025760759391?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/MjBg7rUzr7Q/update-flash-ide-auth-player.html" title="如何更新 Flash CS5.5 內建除錯 Player" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-EI02HEhnuHM/TjymJ_EbDZI/AAAAAAAAIy4/k2shE_OwqrE/s72-c/Flash_AuthPlayer_10_3.png" height="72" width="72" /><thr:total>2</thr:total><content type="html">Ticore's Blog

最近一年來 Flash Player 改版速度變快
光是 10 Major Version，就出了 10.1, 10.2, 10.3 三種 Minor Version
而且還有新增少量的 API
倘若習慣用 Flash IDE Test Movie 方式測試開發新 API 程式
官方又沒發更新檔案的話，就會遇到問題了


相較之下，Flash Builder 開發就沒有這種問題
它完全是用獨立版或是外掛版 Flash Player 來除錯
可以自行更新安裝



我找了一下 Google，國外雖然有人遇到這樣問題
只知道 Flash IDE 除錯播放器是這個檔案



C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\Common\Configuration\
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qmJKRXBjk86jm7MC3PI1OFJYSnY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qmJKRXBjk86jm7MC3PI1OFJYSnY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qmJKRXBjk86jm7MC3PI1OFJYSnY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qmJKRXBjk86jm7MC3PI1OFJYSnY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/MjBg7rUzr7Q" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/08/update-flash-ide-auth-player.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAMQng6eSp7ImA9WhdREU0.&quot;"><id>tag:blogger.com,1999:blog-6934949377658966040.post-3005680836857022534</id><published>2011-07-31T00:12:00.018+08:00</published><updated>2011-07-31T18:06:23.611+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-31T18:06:23.611+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Bug" /><category scheme="http://www.blogger.com/atom/ns#" term="TLF" /><category scheme="http://www.blogger.com/atom/ns#" term="AS3" /><category scheme="http://www.blogger.com/atom/ns#" term="Flex" /><category scheme="http://www.blogger.com/atom/ns#" term="TextEngine" /><category scheme="http://www.blogger.com/atom/ns#" term="Spark" /><title>Flex 4.5 Spark RichEditableText maxChars 與輸入法問題</title><link rel="replies" type="application/atom+xml" href="http://ticore.blogspot.com/feeds/3005680836857022534/comments/default" title="張貼意見" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6934949377658966040&amp;postID=3005680836857022534" title="0 個意見" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/3005680836857022534?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6934949377658966040/posts/default/3005680836857022534?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TicoresBlog/~3/eOdFkHUw9Iw/spark-richeditabletext-maxchars-issue.html" title="Flex 4.5 Spark RichEditableText maxChars 與輸入法問題" /><author><name>{id: "Ticore"}; //</name><uri>http://www.blogger.com/profile/01433005931305983346</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_JHhe1vma7nY/TGuZZdLdB-I/AAAAAAAAIaA/5fAAAkP0AkA/S220/OrigamiMurex.jpg" /></author><thr:total>0</thr:total><content type="html">Ticore's Blog

當在 TextInput, TextArea 等文字組件設定 maxChars 最大字數屬性
使用中文輸入法打了數個字到文字佇列上，超過最大限制字數
然後用 Ctrl + Space 切換輸入法或是按下 Enter 方式輸入文字
結果會發現其它 Binding 到 text 屬性的目標無法取得正確的 text 字串
之後再利用按鈕事件 trace 組件的 text 屬性也是取到錯誤的字串資料



來回 trace 好多程式碼位置之後，發現問題主要是出在 RichEditableText 組件上
不過由於問題原因非常複雜，所以要分成很多段落先解釋一些 TLF 與文字組件運作方式



為什麼要花這麼大力氣找原因?
除了解決問題之外，主要還想要了解一下 TLF 文字引擎的運作方式
令我最驚訝的是，輸入法待選文字佇列功能，居然是 TLF 內建，完全用 AS3 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ne9rSMa9ST7fhV6dtfZboD9_AjE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ne9rSMa9ST7fhV6dtfZboD9_AjE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ne9rSMa9ST7fhV6dtfZboD9_AjE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ne9rSMa9ST7fhV6dtfZboD9_AjE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TicoresBlog/~4/eOdFkHUw9Iw" height="1" width="1"/&gt;</content><feedburner:origLink>http://ticore.blogspot.com/2011/07/spark-richeditabletext-maxchars-issue.html</feedburner:origLink></entry></feed>

