2010年12月24日 星期五

First flash mobile application

這一次使用最新 flash builder burrito 開發 flash 手機應用程式,只是簡單的看影片的功能
因為沒有 android 手機,所以只能在 PC上跑

參考文件
PDF  教學網址  範例網站



這是在PC 上的版本


2010年12月21日 星期二

Flex 4 owner 與 parent的區別


最近才在寫 Flex 4的程式,跟 3有很大的不同,其中一個就是元件屬性 parent
以前就很直覺得就用這個屬性,但 4使用skin 之後就不一樣了,所以必需使用 owner這個屬性囉

Flex 與 Java 使用 URLRequest 傳遞中文參數

這個大家應該都會了,只不我想把它記錄下來

1.在 Flex 內使用 encodeURI(instName) 將中文轉成 utf-8 的 string

2.在 Java 接到 request parameter後作轉碼動作 new String(instName.getBytes("iso-8859-1"),"UTF-8");

2010年12月6日 星期一

下一版的 iphone 會支援 flash

這幾天在將一些之前 flex 3 寫的程式改寫為 pure hero時,突然腦中出現的想法 ,也不知道為什 麼,但它就是出現了

2010年12月3日 星期五

Flex 4 上使用 URLRequest 的注意小地方

如果你原本用Flex Builder 3開發程式有使用 URLRequest ,而且執行上沒問題,但如果用Flex Builder 4 使用相同的程式碼,但執行確碰到 HTTP 405 的訊息的話,請檢查是不是在設定 URLRequest method 上使用了 POST ,請改為 GET再執行一次,應該就可以了

 request.method = URLRequestMethod.GET;

而loader (我用的是URLStream) 要加上新的 EventListener HTTPStatusEvent.HTTP_RESPONSE_STATUS 哦

2010年11月14日 星期日

flash 不透過 Cirrus 使用 p2p

 參考文章


NetConnection成功後的設定
var groupspec:GroupSpecifier = new GroupSpecifier("myGroup/groupOne"); groupspec.postingEnabled = true; groupspec.ipMulticastMemberUpdatesEnabled = true; groupspec.addIPMulticastAddress("225.225.0.1:30303"); group = new NetGroup(nc,groupspec.groupspecWithAuthorizations()); group.addEventListener(NetStatusEvent.NET_STATUS,netStatus);


Event 的處理
要加上
case "NetGroup.Connect.Success": connected = true; break;
case "NetGroup.Posting.Notify": receiveMessage(event.info.message) break;

接受的處理
private function sendMessage(txt:String):void
{
     var message:Object = new Object(); message.text = txt;
     message.sender =       group.convertPeerIDToGroupAddress(nc.nearID);
     message.userName = txtUser.text; group.post(message);
     receiveMessage(message);
    

 }

private function receiveMessage(message:object):void {
   trace(message.userName+": "+message.text);
}

使用FMG連結公司SIP打電話

參考網址1 參考網址2 設定文件

步驟:

2.下載 Flash Media Gateway 並安裝,建議兩套軟体安裝在同一台Server 上

3.Copy the ${FMG-Install-Folder}\/FMSApplications\telephony folder to ${FMS-Install-Folder}\applications\

4.修改 Flash Media Sever的 Server.xml, 在${FMS-Install-Folder}\conf 目錄內
    在 tag Server 下新增一Tag  

5.修改 Flash Media Gateway 的 sip.xml ,在${FMG-Install-Folder}\conf目錄內
    找到 tag profileID 是 sipGateway  ,在tag 內輸入 SIP Server 
    和帳號、宓碼

6.重新啟動 FMS, FMG 後應該就可以打電話囉

文件上還有提到VideoPhone 和 Client profile的部份,如果大家測成功的話也歡迎造訴我如何設定