⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 samplemouseandkey.as

📁 《Flash AS3殿堂之路》光盘源码 学习ActionScript 3.0
💻 AS
字号:
package org.kingda.book.display
{
	import flash.display.Sprite;
	import flash.events.MouseEvent;

	public class SampleMouseAndKey extends Sprite
	{
		public function SampleMouseAndKey() {
			this.stage.addEventListener(MouseEvent.CLICK, clickHandler);			
		}
		private function clickHandler(evt:MouseEvent):void {
			
			var color:uint = 0xffffff;
			if (evt.ctrlKey)	color = 0x66cc00;
			if (evt.altKey) 	color = 0x669933;
			if (evt.shiftKey)	color = 0x66ff00;
			if (evt.altKey && evt.ctrlKey)	color = 0xffcc00;
			if (evt.altKey && evt.shiftKey)	color = 0xffff00;
			if (evt.altKey && evt.ctrlKey && evt.shiftKey) color = 0xff9900;
			trace ("click:" + color.toString(16));
			var star:StarShape = new StarShape(evt.stageX, evt.stageY, 5, 10, 20, 0, color);
			addChild(star);
		}				
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -