2011年2月4日 星期五

利用include as的方式新增/覆寫類別函數

 

利用include as的方式新增/覆寫函數, 可以使多種類別include需要的as而做群集性新增/覆寫函數.

 

- AddMethods.as

- A.as

- B.as

- Main.as

 

範例檔案下載

(Read more...)

2010年2月12日 星期五

Flex Menu客製化上下捲動子選單

這是實作Flex Menu加入客製化的上下捲動子選單, 在rollover up and down時捲動子選單.
以下為效果展示Demo:


(Read more...)

2010年2月11日 星期四

用XML當做Dictionary的key值取出為undfined?

昨天在做Dictionary測試時本來用xml當做key mapping, 結果卻發現用迴圈將xml內資料重新取出return的值卻是undefined.

目前還在找原因為何:S

以下為示範code:

(Read more...)

2010年2月6日 星期六

撲克牌牌型排列組合

最近迷上了一款iphone game : sword & poker, 這款遊戲是運用撲克牌牌型做組合給予敵人傷害的回合制rpg, 相當的耐玩.

因此這幾天花了點時間找資料研究關於撲克牌牌型的演算法, 以下為成果:


希望有機會也能來嘗試作作這類型的遊戲. :D


(Read more...)

2010年1月27日 星期三

QuickBox2D

QuickBox2D

QuickBox2D is a mini-library I created to work with Box2DFlashAS3. The main purpose of this library is to significantly simplify instantiation of rigid bodies and provide a simple way to skin rigid bodies with custom graphics.

可以讓你更為直覺快速建構Box2DFlashAS3物理碰撞環境.
讚! :D

(Read more...)

2010年1月26日 星期二

ListBase設定CSS後ComboxBox下拉選單字體顏色設定失效問題

在flex開發的專案中有用到css設定顏色的功能, 最近遇到ComboBox設定color下拉選單卻無法起作用的問題.後來發現如果在List組件 or ListBase 設CSS color, 會造成ComboBox設定CSS color失效, 造成的原因可能是ComboBox所顯示的下拉選單是ListBase Class的緣故.

我想這應該算是CSS繼承邏輯上的認知問題, 應該不算是什麼bug吧 :p
在這邊特此記錄一下以免又遇到相同狀況.
以下為示範的code :




(Read more...)

2010年1月17日 星期日

AS3 Data Structures For Game Developers (AS3DS)


AS3 Data Structures
AS3 Data Structures (code.google.com)

'AS3 Data Structures For Game Developers' is a package containing common data structures useful for flash game programming and application development. The project was started because I wanted a unified library which I could reuse in my games.

裡面定義許多可以運用的資料結構類別, 對開發遊戲相當地實用. 如果有機會能夠開發遊戲一定要好好研究一下:D

教學範例參考:

the graph class
the tree class
the queue class
the linked lists class 
more on linked list

(Read more...)