当前位置: > > > AS3 - 使用event.stopImmediatePropagation() 停止事件传播

AS3 - 使用event.stopImmediatePropagation() 停止事件传播

private function init():void{
	this.addEventListener("aaa",aaaHanddle);
	this.addEventListener("aaa",bbbHanddle,false,100); //第4个参数,优先级,越大越高。默认1
	dispatchEvent(new Event("aaa")); 
}

private function aaaHanddle(event:Event):void{
	trace("aaaa");
}

private function bbbHanddle(event:Event):void{
	trace("bbbb")
	event.stopImmediatePropagation(); //aaaHanddle()就不会执行了
}
评论0