初探as3的事件对象 |
| 作者:佚名 来源:不详 更新:2007-1-13 20:36:39 错误报告 我要投稿 |
code:
this.addEventListener(MouseEvent.MOUSE_DOWN, clickHandler); function clickHandler(event:MouseEvent):void { trace("时间轴:"+this.name) trace("侦听对象:"+event.target.name) trace("事件名:"+event.type) trace("本地坐标:"+[event.localX,event.localY]); trace("全局坐标:"+[event.stageX,event.stageY]);
} trace: 时间轴:root1 侦听对象:ball_mc 事件名:mouseDown 本地坐标:28,23 全局坐标:231.25,227.10000000000002 很多事件对象的属性是默认的、公有的,有些属性是某些事件特有的
|
|
| 文章录入:skyuu 责任编辑:skyuu |
|
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |