当前位置: 首页 > 工具软件 > SimpleButton > 使用案例 >

AS实现带图像的Simplebutton

颛孙品
2023-12-01

 

[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

 类似资料: