MinimalComps学习

package
{
	import com.bit101.components.PushButton;
	import com.bit101.components.Style;
	
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.MouseEvent;
	
	/**
	 * ...
	 * Keith peters UI组件MinimalComps
	 * 参考:http://zengrong.net/post/1142.htm
	 * @author aisajiajiao
	 */
	public class MiniComponentTest extends Sprite
	{
		private var btn:PushButton;
		
		public function MiniComponentTest()
		{
			Style.fontSize = 12;
			//要使用中文就要将嵌入字体设为false
			Style.embedFonts = false;
			Style.BACKGROUND = 0x000000;
			Style.BUTTON_FACE = 0xCCCCCC;
			
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			
			btn = new PushButton(this,stage.stageWidth >> 1,stage.stageHeight >> 1,"测试",mouseHandler);
			btn.setSize(100,25);
		}
		
		private function mouseHandler(e:MouseEvent):void
		{
			trace("aisajiajiao");
		}
	}
}

你可能感兴趣的:(UI,function,测试,Class,import)