2008年6月30日
Flash event handling
function eventResponse(eventObject:EventType):void
{
// Actions performed in response to the event go here.
}
eventSource.addEventListener(EventType.EVENT_NAME, eventResponse);
Event handling 三要素:
事件來源物件
發生的事件
回應的物件
首先定義一個function,預備當事件發生的時候,就執行它。
然後在來源物件上,加上addEventListener,
發生事件的時候,就呼叫前面定義好的function.
訂閱:
張貼留言 (Atom)
返回Z's Blog首頁
搜尋此網誌
熱門文章
- 2010漫步歐洲-01h: Mont St. Michel 聖米歇爾山(1)
- 利用7-11 iBon列印A3相片
- 哈佛幸福課 #1~#3 簡介 積極心理學 Harvard Positive Psychology
- 2010漫步歐洲02g Barcelona: Casa Batllo 巴特婁之家、 Casa Milà 米拉之家
- 哈佛正義課 第三集 選擇的自由 / 誰擁有我
- 思考,快與慢 Thinking, fast and slow (快思慢想)
- Zard's Blog 2010秋季改版 以後還是多寫Blog卡實在
- 2010漫步歐洲02f Barcelona: Park Güell 奎爾公園(2)
- 2010漫步歐洲08a Venice: From Milan to Venice 從米蘭到威尼斯
- 2008 七月隨手拍
沒有留言:
張貼留言