
这样 this.getChildByName (元件实例名字)这样就可以了 不过也可以用舞台stage做侦听比如AS3的 舞台上的点击事件
stage.addEventListener(MouseEvent.CLICK,onCLICK)
function onCLICK(e:MouseEvent)
{
switch (e.target.name){
case "按钮1":
trace("按钮1");
break;
case "按钮2":
trace("按钮2");
break;
default:
trace("按钮3");
}
这样舞台上所有的按钮(加载的SWF的按钮也包括)就可以做事件了
当然也就是根据舞台上的名字来做的请认清父级子集关系