[Embed(source="pause.gif")] private var Button_PauseImg: Class; var pausebtn: SimpleButton = new SimpleButton(); var pausebtnHitState: Sprite = new Sprite(); pausebtnHitState.addChild(new Button_PauseImg()); pausebtn.upState = pausebtn.downState = pausebtn.overState = pausebtn.hitTestState = pausebtnHitState; pausebtn.addEventListener(MouseEvent.CLICK, pauseClick);
将图片编绎进swf中,见一二行
创建SimpleButton,设置SimpleButton的四种状态为图片所在的Sprite