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首頁
搜尋此網誌
熱門文章
- 利用7-11 iBon列印A3相片
- 思考,快與慢 Thinking, fast and slow (快思慢想)
- [印刷小知識] 單色黑與四色黑的差別
- HBR 2011 五月號 The Power of Small Wins 小勝的力量
- 2010漫步歐洲-01e Paris: Eiffel Tower 艾菲爾鐵塔
- 2010漫步歐洲03d Rome: Streets 羅馬街道
- 2010漫步歐洲-01j Paris: Bois de Vincennes 文森森林公園
- 印度片 3 idiots 三個傻瓜 的風景
- 推薦 哈佛幸福課(積極心理學)Harvard Positive Psychology
- 如何破除、改變習慣? How to break habits?
沒有留言:
張貼留言