2011年6月29日 星期三

[flash<->js] passing json using ExternalInterface

js call flash function(js -> flash)
[in flash]
ExternalInterface.addCallback("getData", fromJs_getData);

[in html]
var obj = document.getElementById("myflashcontent");
obj.getData();

flash call js function(flash ->js)
[in flash]
ExternalInterface.call("sendData", args);

[in html]
function sendData() {
console.log("sendData[0]:"+arguments[0]);
)

Google Maps API for Flash - 基本用法

Google Maps API for Flash
http://code.google.com/intl/zh-TW/apis/maps/documentation/flash/

先去這裡申請 API key
http://code.google.com/intl/zh-TW/apis/maps/signup.html

下載SDK
http://maps.googleapis.com/maps/flash/release/sdk.zip
flash use map_1_20.swc(swf檔案比用map_flex_1_20.swc小)

2011年6月8日 星期三

facebook actionscript api - part2

前一篇寫的落落長,避免以後忘記
包成 swc 方便使用,都已處理 facebook登入 及 取得權限 的部分。
facebook 相簿列表:FBAlbums.swc
facebook 好友列表:FBFriends.swc

範例:
import iqcat.ui.FBAlbumsList;
//import iqcat.ui.FBFriendsList;
//傳入參數:appid, 座標及長寬
var o:Object = { appid:APP_ID, x:10, y:50, w:620, h:330};
addChild(new FBAlbumsList(o));
//addChild(new FBFriendsList(o));