血色残阳的专栏
登录
注册
全站
当前博客
空间
博客
好友
相册
留言
用户操作
[即时聊天]
[发私信]
[加为好友]
王军
ID:wangjun_pfc
共
77851
次访问,排名
1279
好友
11
人,关注者
11
人
wangjun_pfc的文章
原创 256 篇
翻译 0 篇
转载 206 篇
评论 58 篇
最近评论
gaoqin:
看了你的资料我的问题已解决,不过属性文件名我只能写成
messages_zh.properties (中文)
messages_en.properties (英文)
如果像你那样就又出现那个问题,那是什么原因呀!
eagle:
nios的这个编译器做的真叫垃圾,界面乱糟糟的都不知道是些什么,而且编译速度还很慢。比起ADS来那是差远了,用的真是难受。
mayll:
我也成功了
caohenghui:
SB.copy 别人的东西有意思吗!
江桃:
还不错,请继续
文章分类
.net技术
(RSS)
AJAX技术
(RSS)
Eclipse
(RSS)
flex技术
(RSS)
j2ee技术
(RSS)
j2me技术
(RSS)
j2se技术
(RSS)
JavaScript技术
(RSS)
Joomla
(RSS)
Linux
(RSS)
SCJP考题
(RSS)
SOA技术
(RSS)
本体
(RSS)
各种开发工具的使用
(RSS)
股票
(RSS)
精典文章
(RSS)
课程
(RSS)
敏捷开发
(RSS)
嵌入式系统
(RSS)
软件工程
(RSS)
手机
(RSS)
数据库
(RSS)
团队管理
(RSS)
学习心得
(RSS)
收藏
代码下载站
技术学习站
相册
C技术网站
CSDN.NET - 中国最大的IT技术社区
java技术网站
存档
2008年09月(6)
2008年08月(1)
2008年07月(1)
2008年06月(8)
2008年05月(17)
2008年04月(67)
2008年03月(85)
2008年02月(3)
2008年01月(38)
2007年12月(60)
2007年11月(37)
2007年10月(91)
2007年09月(9)
2007年08月(10)
2007年07月(19)
2007年06月(10)
软件项目交易
订阅我的博客
事件处理2
收藏
新一篇: 监听器的移除
|
旧一篇: Event对象的方法
<?
xml version="1.0" encoding="utf-8"
?>
<
mx:Application
xmlns:mx
="http://www.adobe.com/2006/mxml"
layout
="absolute"
creationComplete
="initApp()"
>
<
mx:Script
>
<![CDATA[
import flash.events.MouseEvent;
internal function initApp():void{
canvas1.addEventListener(MouseEvent.CLICK,CanvasHandler);
canvas2.addEventListener(MouseEvent.CLICK,CanvasHandler);
btn1.addEventListener(MouseEvent.CLICK,pressBtn); //因为都没有打开捕获功能,所以输出时从下往上。
btn2.addEventListener(MouseEvent.CLICK,pressBtn,true);
//btn2打开了事件捕获功能,所以输出时从上向下,又因为CanvasHandler函数中有stopImmediatePropagation(),所以到这执行不下去。
}
internal function output(msg:String):void{
txtArea1.text += msg+" ";
}
internal function pressBtn(event:MouseEvent):void{
this.output("是否冒泡---"+event.bubbles);//event.bubbles 表示是否打开冒泡功能
//输出当前的点击对象和事件流当前的阶段,1表示捕获阶段,2表示目标阶段,3表示冒泡阶段
this.output("目标对象:"+event.target+":"+event.eventPhase);
//输出当前正在处理的对象
this.output("遍历对象:"+event.currentTarget);
this.output("------------");
}
internal function CanvasHandler(event:MouseEvent):void{
output("目标对象---"+event.target+"----"+event.eventPhase);
event.stopImmediatePropagation(); //停止事件流的传播
}
]]>
</
mx:Script
>
<
mx:Canvas
x
="10"
y
="10"
width
="328"
height
="355"
id
="canvas1"
>
<
mx:Text
x
="21"
y
="10"
text
="canvas1"
id
="txt1"
/>
<
mx:Canvas
x
="10"
y
="36"
width
="308"
height
="135"
id
="canvas2"
>
<
mx:Text
x
="129"
y
="10"
text
="canvas2"
id
="txt2"
/>
<
mx:Button
x
="118"
y
="55"
label
="Button2"
id
="btn2"
/>
</
mx:Canvas
>
<
mx:Button
x
="21"
y
="179"
label
="Button1"
id
="btn1"
/>
<
mx:TextArea
x
="10"
y
="209"
width
="308"
height
="136"
id
="txtArea1"
/>
</
mx:Canvas
>
</
mx:Application
>
发表于 @
2008年03月30日 19:22:00
|
评论(
loading...
)
|
编辑
新一篇: 监听器的移除
|
旧一篇: Event对象的方法
评论:没有评论。
发表评论
姓 名:
主 页:
校验码:
看不清,换一张
登录