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首頁
搜尋此網誌
熱門文章
- 思考,快與慢 Thinking, fast and slow (快思慢想)
- 簡單準確預測1~2小時之內是否會下雨
- 多動腦保持腦筋靈光 Think faster focus better and remember more Rewiring our brain to stay younger and smarter
- 2010漫步歐洲03f Rome: Piazza Navona 納沃納廣場
- 經濟學人書評 想像力:創意是如何運作的 Imagine: How Creativity Works
- 利用7-11 iBon列印A3相片
- 2010漫步歐洲07b Milan: Milan Cathedral(Duomo) 米蘭主教座堂(1)
- 印度片 3 idiots 三個傻瓜 的風景
- 2010漫步歐洲02d Barcelona: Sagrada Familia 聖家堂, 巴塞隆納(3)
- 2010漫步歐洲-01m - Paris: Eat 巴黎 甜點小吃
沒有留言:
張貼留言