AS3.0 获取场景按钮

来源:互联网 发布:49154端口是什么 编辑:程序博客网 时间:2024/05/11 19:53
protected function listenBtn(sp:Sprite, btnStr:String, func:Function):void{var p:SimpleButton = sp.getChildByName(btnStr) as SimpleButton;p.addEventListener(MouseEvent.CLICK, func);}

//sp:当前场景

//btnStr:按钮名

//func:点击的方法

(listenBtn(_content, "skipbtn", onSkin);)