介紹好用的robotlegs套件

心得筆記 2011/05/31 03:29
robotlegs是一個幫你把專案寫成MVC架構的一個組件 組件下載網址:http://www.robotlegs.org/ 主要分4塊: .MODEL .VIEW .CONTROLLER .SERVICE 四塊元件的協作流程架構圖 http://www.robotlegs.org/diagram/ 學習心得: 1.實作IContext (或繼承Context)作為程式進入點(startup()) 2.Commands用來封裝商業邏輯,譬如點了什麼什麼要顯示這種商業邏輯,要交由Commands來封裝 3.Mediators用來定義一些UI互動的EVENT以及傳送給整個RL架構的EVENT 4.Model, Service 都用 Actor來實作 MODEL:試用來被傳來傳去的封裝資料 SERVICE:用來跟APP之外的API溝通(例如檔案存取,網路服務等) 5.專案中被發出來的EVENT(dispatch(new MoneyChange(MoneyChange.CHANGE));)都會被Context吸收,Context戶在自己發出EVENT出去,想聽的人在 使用addContextListener去接收 6.Mediators利用eventMap.mapListener去抓UI發出來的EVENT(MouseEvent...) 7.eventDispatcher.dispatchEvent()和dispatch()的不同~?...待查 8.[Inject]的功能與特性...待查
top

Trackback Address :: http://diary.tw/allenliao/trackback/945

  1. true religion outlet 2011/10/18 03:59 MODIFY/DELETE REPLY

    true religion jeans outlet where you can buy discount true religion jeans online with worldwide free shipping

  2. Cheap Air Jordans 2011/10/26 02:39 MODIFY/DELETE REPLY

    <a href="http://www.ajcoolgrey.com/">Jordan Shoes</a>,a particular brand which have always stay in the cutting edge sneaker world and dominated the sneaker industry for long time.They casue wide attention and high reputation to people all over the world.This brand of shoes is very fashion.
    The <a href="http://www.ajcoolgrey.com/">Cheap Air Jordans</a>,no matter is in the basketball court or in the noisy street or on the formal party,it will always make you become the most shining star in regard of any matches.The of the shoe was covered with nubuck leather while the toe cap was featured with remarakable accent patent leather which not only durable but also vivid and fresh. Many <a href="http://www.ajcoolgrey.com/">Jordan Shoes For Sale</a> on our website.Come to pick your favorite up.

  3. Cheap Air Jordans 2011/10/26 02:42 MODIFY/DELETE REPLY

    <a href="http://www.ajcoolgrey.com/">Jordan Shoes</a>,a particular brand which have always stay in the cutting edge sneaker world and dominated the sneaker industry for long time.They casue wide attention and high reputation to people all over the world.This brand of shoes is very fashion.
    The <a href="http://www.ajcoolgrey.com/">Cheap Air Jordans</a>,no matter is in the basketball court or in the noisy street or on the formal party,it will always make you become the most shining star in regard of any matches.The of the shoe was covered with nubuck leather while the toe cap was featured with remarakable accent patent leather which not only durable but also vivid and fresh. Many <a href="http://www.ajcoolgrey.com/">Jordan Shoes For Sale</a> on our website.Come to pick your favorite up.

  4. 59fifty new era 2011/11/12 07:15 MODIFY/DELETE REPLY

    The important thing in life is to have a great aim , and the determination to attain it.

  5. 充气娃娃 2011/11/29 15:21 MODIFY/DELETE REPLY

    支持一个,充气娃娃到此。。

  6. china wholesale 2011/11/30 09:33 MODIFY/DELETE REPLY

    Hi, the article is so wonderful, I am interested in it.

  7. air jordan shoes 2011/11/30 09:34 MODIFY/DELETE REPLY

    Thanks for sharing so significative article with us. I agree with your idea competely.

  8. ken griff shoes 2011/11/30 09:34 MODIFY/DELETE REPLY

    This article is impressive,I hope that you will continue doing nice article like this.

  9. kfz Diagnosegeräte 2011/12/09 09:25 MODIFY/DELETE REPLY

    Like your article, welcome to see our car diagnostic tool. We give you the biggest discounts, and the biggest discounts, like BMW diagnostic tool, ford diagnostic tool etc.

  10. kfz Diagnosegeräte 2011/12/09 09:25 MODIFY/DELETE REPLY

    Like your article, welcome to see our car diagnostic tool. We give you the biggest discounts, and the biggest discounts, like BMW diagnostic tool, ford diagnostic tool etc.

Write a comment


一些好用的lib

心得筆記 2010/07/02 05:13
http://code.google.com/p/fcss-lib/
top
TAG flash, lib

Trackback Address :: http://diary.tw/allenliao/trackback/892

  1. north face jackets 2011/10/18 03:59 MODIFY/DELETE REPLY

    North face outlet store where you can buy discount north face fleece, denali jackets for women

  2. Cheap Air Jordans 2011/10/26 02:45 MODIFY/DELETE REPLY

    <a href="http://www.ajcoolgrey.com/">Jordan Shoes</a>,a particular brand which have always stay in the cutting edge sneaker world and dominated the sneaker industry for long time.They casue wide attention and high reputation to people all over the world.This brand of shoes is very fashion.
    The <a href="http://www.ajcoolgrey.com/">Cheap Air Jordans</a>,no matter is in the basketball court or in the noisy street or on the formal party,it will always make you become the most shining star in regard of any matches.The of the shoe was covered with nubuck leather while the toe cap was featured with remarakable accent patent leather which not only durable but also vivid and fresh. Many <a href="http://www.ajcoolgrey.com/">Jordan Shoes For Sale</a> on our website.Come to pick your favorite up.

  3. nba basketball shoes 2011/11/12 07:23 MODIFY/DELETE REPLY

    The important thing in life is to have a great aim , and the determination to attain it.

  4. new era hats 2011/11/12 07:23 MODIFY/DELETE REPLY

    The important thing in life is to have a great aim , and the determination to attain it.

Write a comment


FMS SWF verification--- Application.xml的設定

心得筆記 2009/08/26 04:06
   <Application>
   <SWFVerification enabled="true">
     <SWFFolder>C://Program Files/Adobe/Flash Media Server 3.5/applications/ba/SWFs</SWFFolder>
     <MinGoodVersion />
      <UserAgentExceptions>
         <Exception to="" from="" />
   </UserAgentExceptions>
      <Cache>
        <TTL />
        <UpdateInterval />
   </Cache>
</SWFVerification>
</Application>

你要認證的SWF就放在這裡>>C://Program Files/Adobe/Flash Media Server 3.5/applications/ba/SWFs

他是以編譯時間為主的,同一個FLA你重新編譯ㄧ次,產出的SWF就變的不合法
top
TAG FMS

Trackback Address :: http://diary.tw/allenliao/trackback/821

Write a comment


FLEX心得

心得筆記 2009/06/23 03:15

1.XMLListCollection提供元件 dataprovider的dynamically updates,但是XMLList和XML不行。
2.var loader:Loader = event.currentTarget.loader;
event.target  得到是info
event.currentTarget.loader;//拿到真正的東西

3.XML當MENU元件(tree也可以)的資料提供結構,轉成XMLListCollection的好處是你再RNTIME時期改XML裡的元素,參考你當資料的元件架構也會同步修正
var httpService:HTTPService=new HTTPService();
    httpService.url="data/menu.xml";
    httpService.resultFormat="e4x";
    httpService.addEventListener(ResultEvent.RESULT, onResultHttpService);
    httpService.send();
private function onResultHttpService(e:ResultEvent):void
   {
var viewXMLList:XMLList=XMLList(e.result);
    menuXMLLC=new XMLListCollection(viewXMLList);
    menu.labelField="@label"
    menu.dataProvider=menuXMLLC;
    menu.showRoot=false
}

4.<mx:showDataEffect>要有效果的前提是dataProvider的DATA(expensesAC)要有變化,所以一開始expensesAC先設為空的在ADD INIT時再填值就可以看到效果了

<mx:BubbleChart id="barChart"
       height="100%"
       width="50%"
       paddingRight="5"
       paddingLeft="5"
       showDataTips="true"
       maxRadius="20"
       dataProvider="{expensesAC}"
       >
    <mx:series>


     <mx:BubbleSeries displayName="Month"
          xField="Profit"
          yField="bet"
          radiusField="result"
          fill="{sc1}"
          stroke="{stroke1}">
          <mx:showDataEffect>
          <mx:SeriesInterpolate duration="1000"/>
         </mx:showDataEffect>
     </mx:BubbleSeries>
    </mx:series>
   </mx:BubbleChart>

5.像AS2 FOR IN可以把OBJECT 裡所有的屬性TRACE出來
import mx.utils.ObjectUtil;
trace(ObjectUtil.toString(e))
//這樣就全印出來了


top
TAG Flex

Trackback Address :: http://diary.tw/allenliao/trackback/786

Write a comment


flash javascript 設為首頁語法 安全性限制

心得筆記 2009/02/09 05:00

今天早上遇到一個AS無法成功執行JS的問題,
我想做的功能是,使用者瀏覽SWF然後點擊SWF裡的BTN之後,跳出詢問是否將某個網址設為該瀏覽器的首頁的對話框,實做的流程就是由AS的GETURL或EXTERNALINTERFACE去呼叫頁面上的JS,該JS在去實作將某個網址設為該瀏覽器的首頁的功能

再AS的語法如下

import flash.external.*;

yahoo.onRelease = function() {
 ExternalInterface.call("hi","me");
 //getURL("javascript:hi('hi')", "me");
 //getURL("javascript:var newdiv=document.createElement('div');newdiv.id='divblock';document.body.appendChild(newdiv);newdiv.style.behavior='url(#default#homepage)';newdiv.setHomePage('twimtv.im.tv');");
};


在嵌入該SWF的HTML(main.html)語法如下

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<title>test</title>
<script language="javascript">
function hi(srt){
alert(srt);
var newdiv=document.createElement('div');
newdiv.id='divblock';
document.body.appendChild(newdiv);
newdiv.style.behavior='url(#default#homepage)';
newdiv.setHomePage('http://twimtv.im.tv');
}
</script>
</head>
<body>
<a href="javascript:"></a>
<input type="button" name="dd" onClick="javascript:hi('55')" value="bbfff"/>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="400" id="IFCall" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="movie" value="IFCall.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="IFCall.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="IFCall" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>

用IE瀏覽main.html發現

點擊頁面上的bbfff這個按鈕(非SWF上的按鈕)是可成功執行的(代表這段JS在IE上是正確的)

點擊SWF上的YAHOO這個按鈕,ALERT有成功跳出(代表AS呼叫JS成功),可是卻沒有跑將某個網址設為該瀏覽器的首頁的功能...

上網GOOGLE了一下,看起來像是安全性的限制,看來非要使用者點擊了IE上的按鈕才會觸發這個功能,於是我將這個問題貼上AUG(前MMUG)的M群,經TICORE大的建議將 wmode 設為 opaque~~
對話內容如下:
{id: "Ticore"}; // 說:
 或許可以試試看,將 wmode 設為 opaque~~

x:Allenliao...3.0...想學FMS的人密我~噹噹人 說:
 我試試~^^

{id: "Ticore"}; // 說:
 因為 wmode=window 模式, plugin 上的滑鼠事件與瀏覽器分開的
 將 wmode 設為 opaque~
可能可以讓瀏覽器能抓到使用者點擊的事件

x:Allenliao...3.0...想學FMS的人密我~噹噹人 說:
 成功了
 將 wmode 設為 opaque~~

{id: "Ticore"}; // 說:
:D

於是乎~HTML改成:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<title>test</title>
<script language="javascript">
function hi(srt){
alert(srt);
var newdiv=document.createElement('div');
newdiv.id='divblock';
document.body.appendChild(newdiv);
newdiv.style.behavior='url(#default#homepage)';
newdiv.setHomePage('http://twimtv.im.tv');
}
</script>
</head>
<body>
<a href="javascript:"></a>
<input type="button" name="dd" onClick="javascript:hi('55')" value="bbfff"/>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="400" id="IFCall" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="wmode" value="opaque" />
<param name="movie" value="IFCall.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="IFCall.swf" quality="high" wmode="opaque" bgcolor="#ffffff" width="550" height="400" name="IFCall" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>

就成功了!
讓我們來測看看FF
...幹...失敗了
(待續)

實測發現,FF擋更兇,他管你是不是從頁面上點擊觸發的,一率都擋,所以已經和FLASH沒關係了
GOOGLE找到範例
HTML改成:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
<script language="javascript">
function hi(srt){
alert(srt);
setHomepage('http://www.im.tv')
}


function setHomepage(pageURL)  
{  
 if (document.all)  
    {  
        document.body.style.behavior='url(#default#homepage)';  
  document.body.setHomePage(pageURL);  
   
    }  
    else if (window.sidebar)  
    {  
    if(window.netscape)  
    {  
         try 
   {    
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");    
         }    
         catch (e)    
         {    
    alert( "瀏覽器拒絕此操作,請在地址欄內輸入 about:config 然後將 signed.applets.codebase_principal_support 設為true" );    
         }  
    }   
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);  
    prefs.setCharPref('browser.startup.homepage',pageURL);  
 }  


</script>
</head>
<body>
<a href="javascript:"></a>
<input type="button" name="dd" onClick="javascript:hi('55')" value="bbfff"/>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550"

height="400" id="IFCall" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="wmode" value="opaque" />
<param name="movie" value="IFCall.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="IFCall.swf" quality="high" wmode="opaque" bgcolor="#ffffff" width="550" height="400" name="IFCall" align="middle" allowScriptAccess="always" type="application/x-

shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>


若偵測出被瀏覽器擋住這項操作,會ALERT出一個訊息教你調整FF


top
TAG flash

Trackback Address :: http://diary.tw/allenliao/trackback/706

  1. Tracked from &#35821;&#27861; 2010/08/19 10:21 DELETE

    Subject: &#35821;&#27861;

    &#35821;&#27861;
  2. Tracked from &#28120;&#23453; 2010/10/14 14:00 DELETE

    Subject: &#28120;&#23453;

    &#26080;&#24551;&#36141;&#29289;

Write a comment


Flash 影片飛梭的功能

心得筆記 2008/10/20 09:46

有沒有發現
用flash預設的FLV套件(FLVPLAYBACK) 播放影片,裡頭seekBar的功能,再拖曳seekBar的時候,影片畫面會改變為該拖曳到的秒數應撥放的畫面,可是拖曳起來,那個影片飛梭的速度都沒有YOUTUBE那麼快!
以前有人問我過我這個問題,今天忽然心血來潮,加上又有朋友問我飛梭的功能如何實作,我就又試了一下,答案是:不要用FLVPLACKBACK!

NetStream+Video+自己實作seekBar~SEEK就可以這麼快

in flashCS3 as3

AS2應該也是一樣,因為NetStream+Video是8以前的方案

top

Trackback Address :: http://diary.tw/allenliao/trackback/593

Write a comment


FLASH 大量movieClip被產生,顯示效能提升的撇步

心得筆記 2008/07/25 02:54
下面這段語法會產生10000個MC在contentMc裡面
var idx=0;
while(idx<10000){
var myPixel:MovieClip = contentMc.attachMovie("smallheart", "smallheart"+idx, idx+10);
idx++
}

若你讓FLASH產生了10000個MC,還想做別的特效,你可能要去跟NASA借電腦

但FLASH為MovieClip 提供了一個超棒的屬性,MovieClip.cacheAsBitmap
若這個屬性設成true,你會發現就算產生了一堆MC,FLASH的繪圖速度(動畫效果)還是很快,就是MASO大師之前提到的:點陣繪圖比向量快
這應該是個很棒的例子~
所以依照上面的例子,你覺得應該改成myPixel.cacheAsBitmap=true的效能好還是contentMc.cacheAsBitmap=true的效能好哩?

^ ^

top

Trackback Address :: http://diary.tw/allenliao/trackback/537

  1. cheap snapback hats 2011/11/12 07:23 MODIFY/DELETE REPLY

    The important thing in life is to have a great aim , and the determination to attain it.

Write a comment


player 9.0.115.0 新增一個新的安全性機制

心得筆記 2008/05/16 02:11
http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403030&sliceId=1

>很多HTTP HEADER都被擋住了

http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403185&sliceId=2
>player 9.0.115.0之後的版本在做帶HEADER的REQUEST的時候都會去檢查這一條

所以放在server的crossdomain.xml要多加這個TAG
 <allow-http-request-headers-from domain="*.example.com" headers="*" secure="true"/>

妳應該會遇到的錯誤代碼:
error#2170
top

Trackback Address :: http://diary.tw/allenliao/trackback/499

Write a comment


自訂seekBar 加progress_mc fullness_mc注意的觀念

心得筆記 2007/09/21 04:51
在預設的seekBar組件裡頭沒有fullness_mc需要這個效果要自己加,加法很簡單
弄一個新的圖層新增一個MC取名為fullness_mc(這個instence name不能自己亂改,是定死的)
用戶插入圖片

長度和X座標要和progress_mc一樣就完成了
改長度ㄧ定要點到最裡層去改,不要用拉伸的方式會出錯...
AS2.0或3.0都一樣,在套seekBar的時候要以XSCALE的觀念去作,而他的算法是拿全SEEKBAR的寬去做分母,所以不要擅自把OUTLINE刪去,要不然會少2PX,跑起來會怪怪的
top

Trackback Address :: http://diary.tw/allenliao/trackback/305

Write a comment


說明Camera.setMotionLevel和Microphone.setSilenceLevel對頻寬的影響及功用

心得筆記 2007/08/28 14:59
  • Camera.setMotionLevel() 的設計目的是偵測移動而不會影響頻寬的用法。即使視訊串流未偵測到移動,它還是會傳送視訊。
  • Microphone.setSilenceLevel() 的設計是要讓頻寬最佳化。當音效串流被視為靜音時,就不會傳送音效資料。會改送單一訊息,表示已開始靜音。

上面這2條是從HELP上剪下來的,這裡先說一下Camera.setMotionLevel()這個方法的相關方法運作過程:
1.當(WEBcam.activityLevel>WEBcam.MotionLevel)會造成my_cam.onActivity = function(isActive:Boolean) 裡頭的isActive=true(畫面有動)反之isActive=false(畫面沒有動)
而isActive從false變成true須讓(WEBcam.activityLevel>WEBcam.MotionLevel)這個狀況持續motionTimeOut這屬性設的時間

Microphone.setSilenceLevel() 的原理依樣差別在於
當音效串流被視為靜音時,就不會傳送音效資料。會改送單一訊息,表示已開始靜音。

所以聲音的部份要節省頻寬要靠Microphone
.setSilenceLevel() 這個方法來實作

影像的部份
要節省頻寬要靠setQuality這個方法來實作而非setMotionLevel

top

Trackback Address :: http://diary.tw/allenliao/trackback/279

Write a comment