//mc.addEventListener(Event.REMOVED,on
Removed)
//mc.subMC.addEventListener(Event.REMOVED_FROM_STAGE,on Removed) //输出结果://对象移除subMC //当前对象subMC
mc.removeChild(mc.subMC)
function on Removed(e:Event){ trace ("对象移除"+e.target.name) trace ("当前对象"+e.currentTarget.name) }
转载:
http://blog.csdn.net/wkyb608/article/details/6403899
//输出结果://对象移除subMC //当前对象mc //mc.addEventListener(Event.REMOVED_FROM_STAGE,on Removed) //输出结果:什么都没有
//mc.subMC.addEventListener(Event.REMOVED_FROM_STAGE,on Removed) //输出结果://对象移除subMC //当前对象subMC
mc.removeChild(mc.subMC)
function on Removed(e:Event){ trace ("对象移除"+e.target.name) trace ("当前对象"+e.currentTarget.name) }
我觉得 Event.REMOVED 是元件内部的子元件被移出显示列表时发生的 REMOVED_FROM_STAGE 是元件自己从显示列表中移出时发生的 |
总结:Event.REMOVED能冒泡的
REMOVED_FROM_STAGE不能冒泡