MouseCursor 內共有五個常數 IBEAM, HAND, BUTTON, AUTO, ARROW
Mouse有一個cursor屬性
可以用Mouse.cursor決定使用系統鼠標功能
Mouse.cursor = MouseCursor.IBEAM;
Mouse.cursor = MouseCursor.HAND;
Mouse.cursor = MouseCursor.BUTTON;
Mouse.cursor = MouseCursor.AUTO;
Mouse.cursor = MouseCursor.ARROW;
注意:這功能必須在Flash Player 10才有
2010年8月31日 星期二
2010年8月21日 星期六
2010年8月19日 星期四
AS3 計算 BIG5 碼中文字的筆劃
將字元轉換成big5內碼,因為各編碼是以筆畫做為排序,所以只要取其各筆畫的範圍,就可以區分出各筆畫範圍,以下是傳進一字元,回傳筆畫數
public static function getTraditionalStrokes(char:String):int
{
var byteArr:ByteArray = new ByteArray();
var result:int;
byteArr.writeMultiByte(char, "big5");
var b1:int = byteArr[0] & 0xFF;
var b2:int = byteArr[1] & 0xFF;
var b:int = (b1 << 8) + b2;
if ((b == 0xA440) || (b == 0xA441)) {
result = 1;
}
//2劃
else if (((b >= 0xA442) && (b <= 0xA453)) || ((b >= 0xC940) && (b <= 0xC944))) {
result = 2;
}
//3劃
else if (((b >= 0xA454) && (b <= 0xA47E)) || ((b >= 0xC945) && (b <= 0xC94C))) {
result = 3;
}
//4劃
else if (((b >= 0xA4A1) && (b <= 0xA4FD)) || ((b >= 0xC94D) && (b <= 0xC962))) {
result = 4;
}
//5劃
else if (((b >= 0xA4FE) && (b <= 0xA5DF)) || ((b >= 0xC963) && (b <= 0xC9AA))) {
result = 5;
}
//6劃
else if (((b >= 0xA5E0) && (b <= 0xA6E9)) || ((b >= 0xC9AB) && (b <= 0xCA59))) {
result = 6;
}
//7劃
else if (((b >= 0xA6EA) && (b <= 0xA8C2)) || ((b >= 0xCA5A) && (b <= 0xCBB0))) {
result = 7;
}
//8劃
else if (((b == 0xA260) || (b >= 0xA8C3) && (b <= 0xAB44)) || ((b >= 0xCBB1) && (b <= 0xCDDC))) {
result = 8;
}
//9劃
else if ((b == 0xA259) || (b == 0xF9DA) || ((b >= 0xAB45) && (b <= 0xADBB)) || ((b >= 0xCDDD) && (b <= 0xD0C7))) {
result = 9;
}
//10劃
else if ((b == 0xA25A) || ((b >= 0xADBC) && (b <= 0xB0AD)) || ((b >= 0xD0C8) && (b <= 0xD44A))) {
result = 10;
}
//11劃
else if ((b == 0xA25B) || (b == 0xA25C) || ((b >= 0xB0AE) && (b <= 0xB3C2)) || ((b >= 0xD44B) && (b <= 0xD850))) {
result = 11;
}
//12劃
else if ((b == 0xF9DB) || ((b >= 0xB3C3) && (b <= 0xB6C2)) || ((b >= 0xD851) && (b <= 0xDCB0))) {
result = 12;
}
//13劃
else if ((b == 0xA25D) || (b == 0xA25F) || (b == 0xC6A1) || (b == 0xF9D6) || (b == 0xF9D8)
|| ((b >= 0xB6C3) && (b <= 0xB9AB)) || ((b >= 0xDCB1) && (b <= 0xE0EF))) {
result = 13;
}
//14劃
else if ((b == 0xF9DC) || ((b >= 0xB9AC) && (b <= 0xBBF4)) || ((b >= 0xE0F0) && (b <= 0xE4E5))) {
result = 14;
}
//15劃
else if ((b == 0xA261) || ((b >= 0xBBF5) && (b <= 0xBEA6)) || ((b >= 0xE4E6) && (b <= 0xE8F3))) {
result = 15;
}
//16劃
else if ((b == 0xA25E) || (b == 0xF9D7) || (b == 0xF9D9) || ((b >= 0xBEA7) && (b <= 0xC074))
|| ((b >= 0xE8F4) && (b <= 0xECB8))) {
result = 16;
}
//17劃
else if (((b >= 0xC075) && (b <= 0xC24E)) || ((b >= 0xECB9) && (b <= 0xEFB6))) {
result = 17;
}
//18劃
else if (((b >= 0xC24F) && (b <= 0xC35E)) || ((b >= 0xEFB7) && (b <= 0xF1EA))) {
result = 18;
}
//19劃
else if (((b >= 0xC35F) && (b <= 0xC454)) || ((b >= 0xF1EB) && (b <= 0xF3FC))) {
result = 19;
}
//20劃
else if (((b >= 0xC455) && (b <= 0xC4D6)) || ((b >= 0xF3FD) && (b <= 0xF5BF))) {
result = 20;
}
//21劃
else if (((b >= 0xC4D7) && (b <= 0xC56A)) || ((b >= 0xF5C0) && (b <= 0xF6D5))) {
result = 21;
}
//22劃
else if (((b >= 0xC56B) && (b <= 0xC5C7)) || ((b >= 0xF6D6) && (b <= 0xF7CF))) {
result = 22;
}
//23劃
else if (((b >= 0xC5C8) && (b <= 0xC5F0)) || ((b >= 0xF7D0) && (b <= 0xF8A4))) {
result = 23;
}
//24劃
else if (((b >= 0xC5F1) && (b <= 0xC654)) || ((b >= 0xF8A5) && (b <= 0xF8ED))) {
result = 24;
}
//25劃
else if (((b >= 0xC655) && (b <= 0xC664)) || ((b >= 0xF8EE) && (b <= 0xF96A))) {
result = 25;
}
//26劃
else if (((b >= 0xC665) && (b <= 0xC66B)) || ((b >= 0xF96B) && (b <= 0xF9A1))) {
result = 26;
}
//27劃
else if (((b >= 0xC66C) && (b <= 0xC675)) || ((b >= 0xF9A2) && (b <= 0xF9B9))) {
result = 27;
}
//28劃
else if (((b >= 0xC676) && (b <= 0xC678)) || ((b >= 0xF9BA) && (b <= 0xF9C5))) {
result = 28;
}
//29劃
else if (((b >= 0xC679) && (b <= 0xC67C)) || ((b >= 0xF9C7) && (b <= 0xF9CB))) {
result = 29;
}
//30劃
else if ((b == 0xC67D) || ((b >= 0xF9CC) && (b <= 0xF9CF))) {
result = 30;
}
//31劃
else if (b == 0xF9D0) {
result = 31;
}
//32劃
else if ((b == 0xC67E) || (b == 0xF9D1)) {
result = 32;
}
//33劃
else if ((b == 0xF9C6) || (b == 0xF9D2)) {
result = 33;
}
//35劃
else if (b == 0xF9D3) {
result = 35;
}
//36劃
else if (b == 0xF9D4) {
result = 36;
}
//48劃
else if (b == 0xF9D5) {
result = 48;
}
//trace("result---->" + result);
return result;
}
public static function getTraditionalStrokes(char:String):int
{
var byteArr:ByteArray = new ByteArray();
var result:int;
byteArr.writeMultiByte(char, "big5");
var b1:int = byteArr[0] & 0xFF;
var b2:int = byteArr[1] & 0xFF;
var b:int = (b1 << 8) + b2;
if ((b == 0xA440) || (b == 0xA441)) {
result = 1;
}
//2劃
else if (((b >= 0xA442) && (b <= 0xA453)) || ((b >= 0xC940) && (b <= 0xC944))) {
result = 2;
}
//3劃
else if (((b >= 0xA454) && (b <= 0xA47E)) || ((b >= 0xC945) && (b <= 0xC94C))) {
result = 3;
}
//4劃
else if (((b >= 0xA4A1) && (b <= 0xA4FD)) || ((b >= 0xC94D) && (b <= 0xC962))) {
result = 4;
}
//5劃
else if (((b >= 0xA4FE) && (b <= 0xA5DF)) || ((b >= 0xC963) && (b <= 0xC9AA))) {
result = 5;
}
//6劃
else if (((b >= 0xA5E0) && (b <= 0xA6E9)) || ((b >= 0xC9AB) && (b <= 0xCA59))) {
result = 6;
}
//7劃
else if (((b >= 0xA6EA) && (b <= 0xA8C2)) || ((b >= 0xCA5A) && (b <= 0xCBB0))) {
result = 7;
}
//8劃
else if (((b == 0xA260) || (b >= 0xA8C3) && (b <= 0xAB44)) || ((b >= 0xCBB1) && (b <= 0xCDDC))) {
result = 8;
}
//9劃
else if ((b == 0xA259) || (b == 0xF9DA) || ((b >= 0xAB45) && (b <= 0xADBB)) || ((b >= 0xCDDD) && (b <= 0xD0C7))) {
result = 9;
}
//10劃
else if ((b == 0xA25A) || ((b >= 0xADBC) && (b <= 0xB0AD)) || ((b >= 0xD0C8) && (b <= 0xD44A))) {
result = 10;
}
//11劃
else if ((b == 0xA25B) || (b == 0xA25C) || ((b >= 0xB0AE) && (b <= 0xB3C2)) || ((b >= 0xD44B) && (b <= 0xD850))) {
result = 11;
}
//12劃
else if ((b == 0xF9DB) || ((b >= 0xB3C3) && (b <= 0xB6C2)) || ((b >= 0xD851) && (b <= 0xDCB0))) {
result = 12;
}
//13劃
else if ((b == 0xA25D) || (b == 0xA25F) || (b == 0xC6A1) || (b == 0xF9D6) || (b == 0xF9D8)
|| ((b >= 0xB6C3) && (b <= 0xB9AB)) || ((b >= 0xDCB1) && (b <= 0xE0EF))) {
result = 13;
}
//14劃
else if ((b == 0xF9DC) || ((b >= 0xB9AC) && (b <= 0xBBF4)) || ((b >= 0xE0F0) && (b <= 0xE4E5))) {
result = 14;
}
//15劃
else if ((b == 0xA261) || ((b >= 0xBBF5) && (b <= 0xBEA6)) || ((b >= 0xE4E6) && (b <= 0xE8F3))) {
result = 15;
}
//16劃
else if ((b == 0xA25E) || (b == 0xF9D7) || (b == 0xF9D9) || ((b >= 0xBEA7) && (b <= 0xC074))
|| ((b >= 0xE8F4) && (b <= 0xECB8))) {
result = 16;
}
//17劃
else if (((b >= 0xC075) && (b <= 0xC24E)) || ((b >= 0xECB9) && (b <= 0xEFB6))) {
result = 17;
}
//18劃
else if (((b >= 0xC24F) && (b <= 0xC35E)) || ((b >= 0xEFB7) && (b <= 0xF1EA))) {
result = 18;
}
//19劃
else if (((b >= 0xC35F) && (b <= 0xC454)) || ((b >= 0xF1EB) && (b <= 0xF3FC))) {
result = 19;
}
//20劃
else if (((b >= 0xC455) && (b <= 0xC4D6)) || ((b >= 0xF3FD) && (b <= 0xF5BF))) {
result = 20;
}
//21劃
else if (((b >= 0xC4D7) && (b <= 0xC56A)) || ((b >= 0xF5C0) && (b <= 0xF6D5))) {
result = 21;
}
//22劃
else if (((b >= 0xC56B) && (b <= 0xC5C7)) || ((b >= 0xF6D6) && (b <= 0xF7CF))) {
result = 22;
}
//23劃
else if (((b >= 0xC5C8) && (b <= 0xC5F0)) || ((b >= 0xF7D0) && (b <= 0xF8A4))) {
result = 23;
}
//24劃
else if (((b >= 0xC5F1) && (b <= 0xC654)) || ((b >= 0xF8A5) && (b <= 0xF8ED))) {
result = 24;
}
//25劃
else if (((b >= 0xC655) && (b <= 0xC664)) || ((b >= 0xF8EE) && (b <= 0xF96A))) {
result = 25;
}
//26劃
else if (((b >= 0xC665) && (b <= 0xC66B)) || ((b >= 0xF96B) && (b <= 0xF9A1))) {
result = 26;
}
//27劃
else if (((b >= 0xC66C) && (b <= 0xC675)) || ((b >= 0xF9A2) && (b <= 0xF9B9))) {
result = 27;
}
//28劃
else if (((b >= 0xC676) && (b <= 0xC678)) || ((b >= 0xF9BA) && (b <= 0xF9C5))) {
result = 28;
}
//29劃
else if (((b >= 0xC679) && (b <= 0xC67C)) || ((b >= 0xF9C7) && (b <= 0xF9CB))) {
result = 29;
}
//30劃
else if ((b == 0xC67D) || ((b >= 0xF9CC) && (b <= 0xF9CF))) {
result = 30;
}
//31劃
else if (b == 0xF9D0) {
result = 31;
}
//32劃
else if ((b == 0xC67E) || (b == 0xF9D1)) {
result = 32;
}
//33劃
else if ((b == 0xF9C6) || (b == 0xF9D2)) {
result = 33;
}
//35劃
else if (b == 0xF9D3) {
result = 35;
}
//36劃
else if (b == 0xF9D4) {
result = 36;
}
//48劃
else if (b == 0xF9D5) {
result = 48;
}
//trace("result---->" + result);
return result;
}
Facebook、Twitter和Plurk分享方式
簡易分享方式-直接用URL
- Facebook
- 分享url - http://www.facebook.com/share.php?u=http://www.asuswebstorage.com/&t=asuswebstorage 雲端服務
- u參數是指要分享的url
- t參數是指要分享的文字
- 連到Facebook時,Facebook會自動去抓u所帶網址的Title和圖及說明。所以如果只是要分享網站時,則可以只帶u,要顯示的資料則在網頁設計。
- Twitter
- 分享url - http://twitter.com/home/?status=asuswebstorage 雲端服務 http://www.asuswebstorage.com/"
- status參數是指要分享的內容
- Plurk
- 分享url - http://www.plurk.com/?qualifier=shares&status=http://www.asuswebstorage.com/ (asuswebstorage 雲端服務)
- status參數是指要分享的內容
- 如果有url和顯示的文字,則顯示文字可以接到url後,空一格並用()包起來
- 有url和中文時,必須先做編碼,否則帶過去時,會出錯,如//會不見,中文會變亂碼等
同步式分享-用各社群網站開發API
- Facebook
- 至Facebook開發人員(http://www.facebook.com/developers/),申請應用程式,及填寫資料
- 取得AP的Key和Secret
- 做facebook connet,設定帳密,取得token
- 使用FB API中stream_publish,發佈至塗鴉牆
- API
- JavaScript-http://developers.facebook.com/docs/reference/javascript/
- iOS-http://github.com/facebook/facebook-ios-sdk/
- android-http://github.com/facebook/facebook-android-sdk
- 教學
- milkmidi Blog: Facebook絕對開發Part1 http://milkmidi.blogspot.com/2010/02/facebookpart1.html
- iPhone 開發教學 - 發訊息到 Facebook 塗鴉牆上 http://changyy.pixnet.net/blog/post/25960159
- Twitter
- 至Twitter開發(http://dev.twitter.com/apps),申請應用程式,及填寫資料
- 取得AP的Key和Secret
- 做Twitter connet,設定帳密,取得token
- 使用Twitter API中direct_messages/new
- API
- http://apiwiki.twitter.com/Twitter-API-Documentation
- http://dev.twitter.com/doc
- 教學
- Writing Your First Twitter Application with OAuth | Snipe.Net http://www.snipe.net/2009/07/writing-your-first-twitter-application-with-oauth/
- Plurk
訂閱:
文章 (Atom)