SimpleButton(upState:DisplayObject = null, overState:DisplayObject = null, downState:DisplayObject = null, hitTestState:DisplayObject = null)http://help.adobe.com/zh_TW/FlashPlatform/reference/actionscript/3/flash/display/SimpleButton.html
建立新的 SimpleButton 實體。
1010302__bitmapBtnTest_Jack.swf
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.events.MouseEvent;
import flash.display.SimpleButton;
var bmd1:BitmapData = new BitmapData(100,100,true,0xff2266ff);
var bm1:Bitmap = new Bitmap(bmd1);
bm1.x=100;bm1.y=60;
/*this.addChild(bm1);*/
var bmd2:BitmapData = new BitmapData(100,100,true,0xffff0000);
var bm2:Bitmap = new Bitmap(bmd2);
bm2.x=100;bm2.y=60;
/*this.addChild(bm2);*/
var simpleButton:SimpleButton = new SimpleButton(bm1,bm2,null,bm1);
addChild(simpleButton);
simpleButton.addEventListener(MouseEvent.MOUSE_DOWN,mouseHandler);
function mouseHandler(event:MouseEvent):void{
trace(event.type);
}
trace(getSize(simpleButton));
SimpleButtonDisplayObjectContainer
InteractiveObject
DisplayObject
EventDispatcher
Object
BitmapDisplayObject
EventDispatcher
Object


沒有留言:
張貼留言