AS3.0 KeyCodes 键盘代码
FLASH-as3.0常用代码
FLASH as3.0常用代码1.按钮事件(新版)步骤:实现第一帧暂停:右击第一帧,点动作,写代码stop();实现点按钮开始:放一个按钮(可以在窗口菜单->公用库->按钮里找一个)在第一帧的舞台上,属性面板里给按钮取名:实例名称bt1 ,右击第一帧,点动作,写代码:bt1.addEventListener(MouseEvent.CLICK ,f1);function f1(evt:MouseEvent){gotoAndPlay(2);}//////////////////////////补充:as2(老版)中的按钮事件实现第一帧暂停:右击第一帧,点动作,写代码stop();实现点按钮开始:放一个按钮(可以在窗口菜单->公用库->按钮里找一个)在第一帧的舞台上,右击按钮,点动作,写代码:on (release){ gotoAndPlay(2); }//////////////////////////2.按钮超链接linkButton.addEventListener(MouseEvent.CLICK, gotoAdobeSite);function gotoAdobeSite(event:MouseEvent):void{var adobeURL:URLRequest = new URLRequest("");navigateToURL(adobeURL);}3.随机数Math.random ()输出时间var time1:Date=new Date(); t1.text=time1.toLocaleTimeString();4.画线1graphics.lineStyle(3,0xff0000,0.3);graphics.moveTo(300,100);graphics.lineTo(200,300);画线2graphics.lineStyle(1,0xff0000,1);for(var i:int=0;i<100;i++){graphics.lineTo(Math.random ()*600,Math.random ()*400);}5. 画三角形var m1:MovieClip = new(MovieClip); //声明一个新的mc类bt1,并用new来构造它m1.graphics.lineStyle(2, 0x990000, .75);//使用bt1的graphics属性设置线条粗细,颜色,透明度m1.graphics.beginFill(0x00FF00);//以下的代码是用graphics画三角形。
Flash程序设计(AS3.0)课程常用的键值及常量
下面是常用的键值及常量:键-->keyCode0-->481-->492-->503-->514-->525-->536-->547-->558-->569-->57A-->65B-->66C-->67D-->68E-->69F-->70G-->71H-->72I-->73J-->74K-->75L-->76M-->77N-->78O-->79P-->80Q-->81R-->82S-->83T-->84U-->85V-->86W-->87X-->88Y-->89Z-->90小键盘的KeyCode键-->keyCode0-->961-->972-->983-->994-->1005-->1016-->1027-->1038-->1049-->105*-->106+-->107Enter-->108--->109.-->110/-->111F1~F15键盘KeyCode 键-->keyCodeF1-->112F2-->113F3-->114F4-->115F5-->116F6-->117F7-->118F8-->119F9-->120F10-->121F11-->122F12-->123F13-->124F14-->125F15-->126其他键的KeyCode键-->keyCode BackSpace-->8 Tab-->9Clear-->12Enter-->13Shift-->16Ctrl-->17Alt-->18 CapsLock-->20 Esc-->27Space-->32PageUp-->33PageDown-->34End-->35Home-->36←(左)-->37↑(上)-->38→(右)-->39↓(下)-->40Insert-->45Delete-->46Help-->47NumLock-->144: *-->186; +-->187- =-->189/ ?-->191@ `-->192[ {-->219\ |-->220] }-->221" '-->222KeyCode定数一览表键-->定数BackSpace-->Keyboard.BACKSPACE CapsLock-->Keyboard.CAPS_LOCK Control-->Keyboard.CONTROL Delete-->Keyboard.DELETEEnd-->Keyboard.ENDEnter-->Keyboard.ENTEREscape-->Keyboard.ESCAPEF1-->Keyboard.F1F2-->Keyboard.F2F3-->Keyboard.F3F4-->Keyboard.F4F5-->Keyboard.F5F6-->Keyboard.F6F7-->Keyboard.F7F8-->Keyboard.F8F9-->Keyboard.F9F10-->Keyboard.F10F11-->Keyboard.F11F12-->Keyboard.F12F13-->Keyboard.F13F14-->Keyboard.F14F15-->Keyboard.F15Home-->Keyboard.HOMEInsert-->Keyboard.INSERTNUMPAD 0-->Keyboard.NUMPAD_0 NUMPAD 1-->Keyboard.NUMPAD_1 NUMPAD 2-->Keyboard.NUMPAD_2 NUMPAD 3-->Keyboard.NUMPAD_3 NUMPAD 4-->Keyboard.NUMPAD_4 NUMPAD 5-->Keyboard.NUMPAD_5 NUMPAD 6-->Keyboard.NUMPAD_6 NUMPAD 7-->Keyboard.NUMPAD_7 NUMPAD 8-->Keyboard.NUMPAD_8 NUMPAD 9-->Keyboard.NUMPAD_9 NUMPAD +-->Keyboard.NUMPAD_ADD NUMPAD .-->Keyboard.NUMPAD_DECIMAL NUMPAD /-->Keyboard.NUMPAD_DIVIDE NUMPAD Enter-->Keyboard.NUMPAD_ENTER NUMPAD *-->Keyboard.NUMPAD_MULTIPLY NUMPAD --->Keyboard.NUMPAD_SUBTRACT Page Up-->Keyboard.PAGE_UPPage Down-->Keyboard.PAGE_DOWNArrow Up-->Keyboard.UPArrow Down-->Keyboard.DOWNArrow Left-->Keyboard.LEFTArrow Right-->Keyboard.RIGHTShift-->Keyboard.SHIFTSpace-->Keyboard.SPACETab-->Keyboard.TAB。
键盘ASCII码值对照表
键盘ASCII码值对照表0x1 鼠标左键0x2 鼠标右键0x3 CANCEL 键0x4 鼠标中键0x8 BACKSPACE 键0x9 TAB 键0xC CLEAR 键0xD ENTER 键0x10 SHIFT 键0x11 CTRL 键0x12 MENU 键0x13 PAUSE 键0x14 CAPS LOCK 键0x1B ESC 键0x20 SPACEBAR 键0x21 PAGE UP 键0x22 PAGE DOWN 键0x23 END 键0x24 HOME 键0x25 LEFT ARROW 键0x26 UP ARROW 键0x27 RIGHT ARROW 键0x28 DOWN ARROW 键0x29 SELECT 键0x2A PRINT SCREEN 键0x2B EXECUTE 键0x2C SNAPSHOT 键0x2D INSERT 键0x2E DELETE 键0x2F HELP 键0x90 NUM LOCK 键====================================大小写字母的 ASCII 码相同:值描述65 A 键66 B 键67 C 键68 D 键69 E 键70 F 键71 G 键74 J 键75 K 键76 L 键77 M 键78 N 键79 O 键80 P 键81 Q 键82 R 键83 S 键84 T 键85 U 键86 V 键87 W 键88 X 键89 Y 键90 Z 键===================================0 至9 键的ASCII 码:值描述48 0 键49 1 键50 2 键51 3 键52 4 键53 5 键54 6 键55 7 键56 8 键57 9 键===================================下列常数代表数字键盘上的键:值描述0x60 0 键0x61 1 键0x62 2 键0x63 3 键0x64 4 键0x65 5 键0x66 6 键0x67 7 键0x6A MULTIPLICATION SIGN (*) 键0x6B PLUS SIGN (+) 键0x6C ENTER 键0x6D MINUS SIGN (–) 键0x6E DECIMAL POINT (.) 键0x6F DIVISION SIGN (/) 键====================================下列常数代表功能键:值描述0x70 F1 键0x71 F2 键0x72 F3 键0x73 F4 键0x74 F5 键0x75 F6 键0x76 F7 键0x77 F8 键0x78 F9 键0x79 F10 键0x7A F11 键0x7B F12 键0x7C F13 键0x7D F14 键0x7E F15 键0x7F F16 键====================================ASCII 码对照表Char Dec Oct Hex | Char Dec Oct Hex | Char Dec Oct Hex | Char Dec Oct Hex ------------------------------------------------------------------------------------- (nul) 0 0000 0x00 | (sp) 32 0040 0x20 | @ 64 0100 0x40 | ` 96 0140 0x60(soh) 1 0001 0x01 | ! 33 0041 0x21 | A 65 0101 0x41 | a 97 0141 0x61(stx) 2 0002 0x02 | " 34 0042 0x22 | B 66 0102 0x42 | b 98 0142 0x62(etx) 3 0003 0x03 | # 35 0043 0x23 | C 67 0103 0x43 | c 99 0143 0x63(eot) 4 0004 0x04 | $ 36 0044 0x24 | D 68 0104 0x44 | d 100 0144 0x64(enq) 5 0005 0x05 | % 37 0045 0x25 | E 69 0105 0x45 | e 101 0145 0x65(ack) 6 0006 0x06 | & 38 0046 0x26 | F 70 0106 0x46 | f 102 0146 0x66(bel) 7 0007 0x07 | ' 39 0047 0x27 | G 71 0107 0x47 | g 103 0147 0x67(bs) 8 0010 0x08 | ( 40 0050 0x28 | H 72 0110 0x48 | h 104 0150 0x68(ht) 9 0011 0x09 | ) 41 0051 0x29 | I 73 0111 0x49 | i 105 0151 0x69(nl) 10 0012 0x0a | * 42 0052 0x2a | J 74 0112 0x4a | j 106 0152 0x6a(vt) 11 0013 0x0b | + 43 0053 0x2b | K 75 0113 0x4b | k 107 0153 0x6b(np) 12 0014 0x0c | , 44 0054 0x2c | L 76 0114 0x4c | l 108 0154 0x6c(cr) 13 0015 0x0d | - 45 0055 0x2d | M 77 0115 0x4d | m 109 0155 0x6d(so) 14 0016 0x0e | . 46 0056 0x2e | N 78 0116 0x4e | n 110 0156 0x6e(si) 15 0017 0x0f | / 47 0057 0x2f | O 79 0117 0x4f | o 111 0157 0x6f(dle) 16 0020 0x10 | 0 48 0060 0x30 | P 80 0120 0x50 | p 112 0160 0x70 (dc1) 17 0021 0x11 | 1 49 0061 0x31 | Q 81 0121 0x51 | q 113 0161 0x71 (dc2) 18 0022 0x12 | 2 50 0062 0x32 | R 82 0122 0x52 | r 114 0162 0x72 (dc3) 19 0023 0x13 | 3 51 0063 0x33 | S 83 0123 0x53 | s 115 0163 0x73 (dc4) 20 0024 0x14 | 4 52 0064 0x34 | T 84 0124 0x54 | t 116 0164 0x74 (nak) 21 0025 0x15 | 5 53 0065 0x35 | U 85 0125 0x55 | u 117 0165 0x75 (syn) 22 0026 0x16 | 6 54 0066 0x36 | V 86 0126 0x56 | v 118 0166 0x76 (etb) 23 0027 0x17 | 7 55 0067 0x37 | W 87 0127 0x57 | w 119 0167 0x77 (can) 24 0030 0x18 | 8 56 0070 0x38 | X 88 0130 0x58 | x 120 0170 0x78 (em) 25 0031 0x19 | 9 57 0071 0x39 | Y 89 0131 0x59 | y 121 0171 0x79(sub) 26 0032 0x1a | : 58 0072 0x3a | Z 90 0132 0x5a | z 122 0172 0x7a(esc) 27 0033 0x1b | ; 59 0073 0x3b | [ 91 0133 0x5b | { 123 0173 0x7b(fs) 28 0034 0x1c | < 60 0074 0x3c | \ 92 0134 0x5c | | 124 0174 0x7c(gs) 29 0035 0x1d | = 61 0075 0x3d | ] 93 0135 0x5d | } 125 0175 0x7d(rs) 30 0036 0x1e | > 62 0076 0x3e | ^ 94 0136 0x5e | ~ 126 0176 0x7e(us) 31 0037 0x1f | ? 63 0077 0x3f | _ 95 0137 0x5f | (del) 127 0177 0x7f====================================常数值描述vbKeyLButton 1 鼠标左键vbKeyRButton 2 鼠标右键vbKeyCancel 3 CANCELvbKeyMButton 4 鼠标中键vbKeyBack 8 BACKSPACEvbKeyTab 9 TABvbKeyClear 12 CLEARvbKeyReturn 13 ENTERvbKeyShift 16 SHIFTvbKeyControl 17 CTRLvbKeyMenu 18 菜单键vbKeyPause 19 PAUSEvbKeyCapital 20 CAPS LOCKvbKeyEscape 27 ESCvbKeySpace 32 SPACEBARvbKeyPageUp 33 PAGEUPvbKeyPageDown 34 PAGEDOWNvbKeyEnd 35 ENDvbKeyHome 36 HOMEvbKeyLeft 37 LEFT ARROWvbKeyUp 38 UP ARROW vbKeyRight 39 RIGHT ARROW vbKeyDown 40 DOWN ARROW vbKeySelect 41 SELECT vbKeyPrint 42 PRINT SCREEN vbKeyExecute 43 EXECUTE vbKeySnapshot 44 SNAP SHOT vbKeyInser 45 INSvbKeyDelete 46 DELvbKeyHelp 47 HELP vbKeyNumlock 144 NUM LOCKvbKeyA 65 AvbKeyB 66 BvbKeyC 67 CvbKeyD 68 DvbKeyE 69 EvbKeyF 70 FvbKeyG 71 GvbKeyH 72 HvbKeyI 73 IvbKeyJ 74 JvbKeyK 75 KvbKeyL 76 LvbKeyM 77 MvbKeyN 78 NvbKeyO 79 OvbKeyP 80 PvbKeyQ 81 QvbKeyR 82 RvbKeyS 83 SvbKeyT 84 TvbKeyU 85 UvbKeyV 86 VvbKeyW 87 WvbKeyX 88 XvbKeyY 89 YvbKeyZ 90 ZvbKey0 48 0vbKey1 49 1vbKey2 50 2vbKey3 51 3vbKey4 52 4vbKey5 53 5vbKey6 54 6vbKey7 55 7vbKey8 56 8vbKey9 57 9数字小键盘上的键vbKeyNumpad0 96 0vbKeyNumpad1 97 1vbKeyNumpad2 98 2vbKeyNumpad3 99 3vbKeyNumpad4 100 4vbKeyNumpad5 101 5vbKeyNumpad6 102 6vbKeyNumpad7 103 7vbKeyNumpad8 104 8vbKeyNumpad9 105 9vbKeyMultiply 106 乘号(*)vbKeyAdd 107 加号(+) vbKeySeparator 108 ENTER(在数字小键盘上)vbKeySubtract 109 减号(-)vbKeyDecimal 110 小数点(.)vbKeyDivide 111 除号(/)功能键vbKeyF1 112 F1vbKeyF2 113 F2vbKeyF3 114 F3vbKeyF4 115 F4vbKeyF5 116 F5vbKeyF6 117 F6vbKeyF7 118 F7vbKeyF8 119 F8vbKeyF9 120 F9vbKeyF10 121 F10vbKeyF11 122 F11vbKeyF12 123 F12vbKeyF13 124 F13vbKeyF14 125 F14vbKeyF15 126 F15vbKeyF16 127 F16。
flash as3.0 常用代码
flash as3.0 常用代码1.全屏播放fscommand("fullscreen",true);2.打开时全屏,在该帧停止fscommand("fullscreen",true);stop();3.跳帧播放(从第几针开始播放后)on (press) {gotoAndPlay(?);}4.点击时开始播放on (press) {play();}5.退出语句如果是FLASH自带的控件on (click){ fscommand("quit",""); } 自已做的按钮on (release){ fscommand("quit",""); }6、当鼠标滑过影片剪辑时,停止播放时间轴。
on (rollOver) {_root.stop();}7、当在影片剪辑上按下鼠标时,停止播放影片剪辑。
on (press) {stop();}8、当影片剪辑上松开鼠标时,播放影片剪辑。
on (release) {play();}9、当鼠标滑离影片剪辑时,播放当前时间轴。
on (rollOut) {_root.play();}10、Goto:跳到一个指定的帧(Frame)Scene: 指定SceneFrame:Number,Label,Expression,Next Frame,Previous Frame 可以选择Frame 的编号,标号,通过表达式,下一帧,前一帧Expression: 定义表达式Control:Go to and Play,Go to and Stop 经过选择这个项目来确定到达指定的帧以后是继续播放还是停止例:Go to and Play (1) 跳到第一帧播放Go to Next Frame 跳到下一帧播放Go to and Stop ("intro") 跳到标号为intro 的帧播11、Play:播放Stop:停止Toggle High Quality:切换画面的细节程度Stop All Sounds:停止所有声音Get URL:打开指定的网址URL: 网址Windows:_self,_blank,_parent,_top 打开网址时使用的目标Variables on’t Send,Send use GET,Send use POST 变量的传递方式例:Get URL ("next.asp", window="_blank", vars=POST) 在新窗口中打开next.asp,并且传递参数12、FScommand:调用命令Command: 命令Arguments: 参数For standalone player:fullscreen,allowscale,showmenu,exec,quit 播放器使用的固定命令和参数例:FS Command ("fullscreen", "true") 设置全屏幕播放13、Load/Unload Movie:调入/释放外部的影片Action:Load movie into location,Unload movie from location,Load variables into location: 可以选择是否调入新影片,释放已经调入的影片,调入变量URL:影片的网址Location:Level,Target: 调入的层,或者是某一目标对象的位置Variables on’t Send,Send use GET,Send use POST: 变量的传递方式例子:Load Movie ("test.swf", 1): 把test.swf 调入到第一层Load Movie ("test.swf", "loadit", vars=GET): 把test.swf 调入到loadit 目标对象的位置Unload Movie ("loadit"): 把loadit 目标对象处的影片释放Load Variables ("makeit.asp", 2, vars=GET): 调用makeit.asp 并接收返回的变量14、Tell Target:指定目标对象Target: 目标对象例:Begin Tell Target ("obj") 指定目标对象objEnd Tell Target15、If Frame is Loaded:判断某帧是否调入Scene: 指定场景Frame:Number,Label,Expression: 指定帧,标号或者表达式Expression: 表达式例:If Frame Is Loaded (Scene 1, "end")End Frame Loaded:判断场景一的标号为end 的帧是否调入16、On MouseEvent 鼠标时间响应Event ress,Release,Release Outside,Roll Over,Roll Out,Drag Over,Drag Out,Key Press 各种事件:按下,放开,在外面放开,焦点移入,移出,拖过,拖出,按键按下例:On (Press) 鼠标按下的时候End OnOn (Key: s) 键盘上s 按下的时候End On17、If 判断条件是否成立Condition: 条件Add Else/Else If clause: 加入Else 再次判断例:If (a=10) 如果a=10 那么……End IfIf (a=10) 如果a=10 那么……不然……ElseEnd If18、Loop 循环Condition: 条件例:Loop While (a=10) 如果a=10 那么循环End Loop19、Call 调用函数帧或对象Frame: 函数帧例:Call ("make") 调用make 帧程序20、Set Property 设置属性Set:Y Positon,X Position,Y Scale,XScale,Alpha,Visibility,Rotation,Name,High quality,Show focus rectangle,Sound buffer time 设置y 坐标,x坐标,y 放大倍数,x 放大倍数,透明度,可视否,旋转角度,名称,精细度,焦点矩形框否是显示,声音缓冲的时间(默认5秒)Target: 目标对象value: 值例:Set Property ("aoe", X Position) = "12" 设置目标对象aoe 的x 坐标为12Set Property (Show focus rectangle) = "0" 取消焦点框21、Set Variable 设置变量Variable: 变量value: 值例:Set Variable: "test" = 10 设置test=1022、Duplicate/Remove Movie Clip 复制对象Action uplicate movie clip,Remove duplicate movie clip 可选择是复制还是删除Target: 目标对象New name: 新目标对象的名字Depth: 深度例:Duplicate Movie Clip ("aoe", "aoe2", 1) 复制aoe 一个新的动画,名字叫aoe2Remove Movie Clip ("aoe2") 删除目标对象aoe223、Drag Movie Clip 拖动影片片段Start drag operation: 开始拖动Target: 目标对象Constrain to rectangle:Left,Top,Right,Bottom 鼠标的位置,左上右下Lock mouse to center: 鼠标放置在中心Stop drag operation 停止拖动例:Start Drag ("aoe", L=2, T=3, R=4, B=5) 拖动目标对象aoe,位置在L=2, T=3, R=4, B=5Start Drag ("aoe", lockcenter) 拖动目标对象aoe,位置是在中心Stop Drag 停止拖动24、Trace 跟踪Message: 信息例:Trace ("aoe") 显示aoeTrace (aoe) 显示aoe 的值25、Comment 注释Comment: 注释例子:Comment ("计算") 注释:计算box_btn.onPress=function(){trace("ok");};按钮实例名称.事件处理方法=function(){ //处理程序};例如:n=1box_btn.onRelease=function(){n=n+1trace("n="+n);}当按钮被点一下的时候,Output窗口会输出:"n=2"onClipEvent(load){stop();}上面是影片剪辑的事件处理函数。
ASCII码表和键盘键码表(完整珍藏版)
ASCII码表和键盘键码表(完整珍藏版)表一:ASCII 码表(完整版)ASCII值字符ASCII值字符ASCII值字符ASCII值字符0NUT32(space)64@96、1SOH33!65A97a 2STX34”66B98b 3ETX35#67C99c4EOT36$68D100d 5ENQ37%69E101e6ACK38&70F102f7BEL39,71G103g 8BS40(72H104h 9HT41)73I105i 10LF42*74J106j 11VT43+75K107k 12FF44,76L108l 13CR45-77M109m 14SO46.78N110n 15SI47/79O111o 16DLE48080P112p 17DCI49181Q113q 18DC250282R114r 19DC351383X115s 20DC452484T116t 21NAK53585U117u 22SYN54686V118v 23TB55787W119w 24CAN56888X120x 25EM57989Y121y 26SUB58:90Z122z 27ESC59;91[123{ 28FS60<92/124| 29GS61=93]125} 30RS62>94^126~ 31US63? 95—127DEL 注:特殊控制字符所代表含义NUL 空VT 垂直制表SYN 空转同步HT 横向列表SOH 标题开始FF 走纸控制ETB 信息组传送结束LF 换行STX 正文开始CR 回车CAN 作废GS 组分隔符ETX 正文结束SO 移位输出EM 纸尽NAK 否定EOY 传输结束SI 移位输入SUB 换置US 单元分隔符ENQ 询问字符DLE 空格ESC 换码DEL 删除ACK 承认BS 退一格FS 文字分隔符RS 记录分隔符DC1 设备控制1DC2 设备控制2DC3 设备控制3DC4 设备控制4 BEL 报警表二:104键盘码表(完整版)控制键常数值健描述常数值健描述vbKeyLButton 1 鼠标左键vbKeyPageDown 34 PageDown 键vbKeyRButton 2 鼠标右键vbKeyEnd 35 End键vbKeyCancel 3 Cancel 键vbKeyHome 36Home 键vbKeyMButton 4 鼠标中键vbKeyLeft 37 左方向键vbKeyBack 8 Backspace健vbKeyUp 38 上方向键vbKeyTab 9 Tab 键vbKeyRight 39 右方向键vbKeyClear 12 Clear 键vbKeyDown 40 下方向键vbKeyReturn 13 Enter 键vbKeySelect 41 Select 键vbKeyShift 16 Shift键vbKeyPrint 42 Print Screen键vbKeyControl 17 Ctrl 键vbKeyExecute 43 Execute 键vbKeyMenu 18 菜单键vbKeySnapshot 44 Snap Shot键vbKeyPause 19 Pause 键vbKeyInser 45 Ins 键vbKeyCapital 20 Caps Lock 键vbKeyDelete 46 Del 键vbKeyEscape 27 Esc 键vbKeyHelp 47 Help 键vbKeySpace 32 Spacebar 键vbKeyNumlock 144 Num Lock 键vbKeyPageUp 33 Page Up字母按健字母区数字键常数(vbKeyA ~ vbKeyZ) <==>键码(65 ~ 90) <==>字母(A ~ Z)健可对照ASCII表常数(vbKey0 ~ vbKey9 ) <==>键码(48 ~ 57) <==>数字(0 ~ 9)健可对照ASCII表数字小键盘区按键F功能健常数值健描述常数值健描述vbKeyNumpad0 96 Num 0键vbKeyF1 112 F1键vbKeyNumpad1 97 Num 1键vbKeyF2 113 F2键vbKeyNumpad2 98 Num 2键vbKeyF3 114 F3键vbKeyNumpad3 99 Num 3键vbKeyF4 115 F4键vbKeyNumpad4 100 Num 4键vbKeyF5 116 F5键vbKeyNumpad5 101 Num 5键vbKeyF6 117 F6键vbKeyNumpad6 102 Num 6键vbKeyF7 118 F7键vbKeyNumpad7 103 Num 7键vbKeyF8 119 F8键vbKeyNumpad8 104 Num 8键vbKeyF9 120 F9键vbKeyNumpad9 105 Num 9键vbKeyF10 121 F10键vbKeyMultiply 106 (*) 键vbKeyF11 122 F11键vbKeyAdd 107 (+) 键vbKeyF12 123 F12键vbKeySeparator 108 Enter健vbKeyF13 124 F13键vbKeySubtract 109 (-) 键vbKeyF14 125 F14键vbKeyDecimal 110 (.) 键vbKeyF15 126 F15键vbKeyDivide 111 (/) 键vbKeyF16 127 F16键3、通过活动,使学生养成博览群书的好习惯。
flash as3.0按钮代码
AS3.0代码单击按钮时播放到第五帧的Btn.addEventListener(MouseEvent.CLICK,onClick);functiononClick(Evt:MouseEvent){gotoAndStop(totalFrames);}复制代码FLASH CS3 AS3.0 按钮如何制作代码如何写stop();按钮.addEventListener(MouseEvent.MOUSE_DOWN,MouseDown);function MouseDown(event:MouseEvent):void{gotoAndStop(2);//执行按钮}_root.MC.按钮可以获得按钮;//as 2.0_root.MC.按钮=function() { //执行按钮}//as 3.0root.MC.按钮.addEventListener(MouseEvent.MouseDown,MouseDown);function MouseDown(event:MouseEvent):void { //执行按钮}案例2:熟悉addChild和removeChild在不同的swf之间的运用,以及loader的用法说明:点击picture会载入另一个swf,点击载入的swf上的一个按钮,该swf消失。
代码:swfA(也就是按钮所在的flash)varloader:Loader = new Loader();loader.load(new URLRequest("Popup.swf"));picture_btn.addEventListener(MouseEvent.CLICK, showPicture);function showPicture(event:MouseEvent):void{addChild(loader);}AS3里用loader代替了loadMovie,load的时候不能直接添加路径名,需要通过URLRequest来载入。
as3.0键盘控制移动
F11 <--------> 122
F12 <--------> 123
F13 <--------> 124
F14 <--------> 125
F15 <--------> 126
Backspace <--------> 8
Tab <--------> 9
Clear <--------> 12
onClipEvent(load){
speed = 10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
this._x -= speed;
} else if (Key.isDown(Key.RIGHT) ){
this._x += speed;
Delete <--------> 46
Help <--------> 47
Num Lock <--------> 144
; : <--------> 186
= + <--------> 187
- _ <--------> 189
/ ? <--------> 191
` ~ <--------> 192
Enter <--------> 13
Shift <--------> 16
Control <--------> 17
Alt <--------> 18
ASCII码表与按键大全
ASCII码表ASCII值控制字符ASCII值控制字符ASCII值控制字符ASCII值控制字符0 NUT 32 (space) 64 @ 96 、1 SOH 33 !65 A 97 a2 STX 34 ” 66 B 98 b3 ETX 35 # 67 C 99 c4 EOT 36 $ 68 D 100 d5 ENQ 37 % 69 E 101 e6 ACK 38 & 70 F 102 f7 BEL 39 , 71 G 103 g8 BS 40 ( 72 H 104 h9 HT 41 ) 73 I 105 i10 LF 42 * 74 J 106 j11 VT 43 + 75 K 107 k12 FF 44 , 76 L 108 l13 CR 45 - 77 M 109 m14 SO 46 . 78 N 110 n15 SI 47 / 79 O 111 o16 DLE 48 0 80 P 112 p17 DCI 49 1 81 Q 113 q18 DC2 50 2 82 R 114 r19 DC3 51 3 83 X 115 s20 DC4 52 4 84 T 116 t21 NAK 53 5 85 U 117 u22 SYN 54 6 86 V 118 v23 TB 55 7 87 W 119 w24 CAN 56 8 88 X 120 x25 EM 57 9 89 Y 121 y26 SUB 58 : 90 Z 122 z27 ESC 59 ; 91 [ 123 {28 FS 60 < 92 \ 124 |29 GS 61 = 93 ] 125 }30 RS 62 > 94 ^ 126 ~31 US 63 ? 95 __ 127 DELNUL VT 垂直制表SYN 空转同步SOH 标题开始FF 走纸控制ETB 信息组传送结束STX 正文开始CR 回车CAN 作废ETX 正文结束SO 移位输出EM 纸尽EOY 传输结束SI 移位输入SUB 换置ENQ 询问字符DLE 空格ESC 换码ACK 承认DC1 设备控制1 FS 文字分隔符BEL 报警DC2 设备控制2 GS 组分隔符BS 退一格DC3 设备控制3 RS 记录分隔符HT 横向列表DC4 设备控制4 US 单元分隔符LF 换行NAK 否定DEL 删除键盘常用ASCII码键盘常用ASCII码ESC键VK_ESCAPE (27)回车键:VK_RETURN (13)TAB键:VK_TAB (9)Caps Lock键:VK_CAPITAL (20)Shift键:VK_SHIFT ($10)Ctrl键:VK_CONTROL (17)Alt键:VK_MENU (18)空格键:VK_SPACE ($20/32)退格键:VK_BACK (8)左徽标键:VK_LWIN (91)右徽标键:VK_LWIN (92)鼠标右键快捷键:VK_APPS (93)Insert键:VK_INSERT (45)Home键:VK_HOME (36)Page Up:VK_PRIOR (33)PageDown:VK_NEXT (34)End键:VK_END (35)Delete键:VK_DELETE (46)方向键(←):VK_LEFT (37)方向键(↑):VK_UP (38)方向键(→):VK_RIGHT (39)方向键(↓):VK_DOWN (40)F1键:VK_F1 (112)F2键:VK_F2 (113)F3键:VK_F3 (114)F4键:VK_F4 (115)F5键:VK_F5 (116)F6键:VK_F6 (117)F7键:VK_F7 (118)F8键:VK_F8 (119)F9键:VK_F9 (120)F10键:VK_F10 (121)F11键:VK_F11 (122)F12键:VK_F12 (123)Num Lock键:VK_NUMLOCK (144)小键盘0:VK_NUMPAD0 (96)小键盘1:VK_NUMPAD0 (97)小键盘2:VK_NUMPAD0 (98)小键盘3:VK_NUMPAD0 (99)小键盘4:VK_NUMPAD0 (100)小键盘5:VK_NUMPAD0 (101)小键盘6:VK_NUMPAD0 (102)小键盘7:VK_NUMPAD0 (103)小键盘8:VK_NUMPAD0 (104)小键盘9:VK_NUMPAD0 (105)小键盘.:VK_DECIMAL (110)小键盘*:VK_MULTIPLY (106)小键盘+:VK_MULTIPLY (107)小键盘-:VK_SUBTRACT (109)小键盘/:VK_DIVIDE (111)Pause Break键:VK_PAUSE (19)Scroll Lock键:VK_SCROLL (145)DEC多国字符集(MCS)-ASCII码表DEC 多国字符集 (MCS) 包括由十六进制值 00 至FF 标识的字符定义,是过去数字设备公司 (Digital Equipment Corporation) 建立和使用的。
最全ASCII对应码表-键值
OCT(八进制)最全ASCII码对应表—与键盘按键对应值(二进)Bin (十进)Dec (十六进)Hex 缩写/字符解释0000 0000 0 00 NUL (null) 空字符0000 0001 1 01 SOH (start of handing) 标题开始0000 0010 2 02 STX (start of text) 正文开始0000 0011 3 03 ETX (end of text) 正文结束0000 0100 4 04 EOT (end of transmission) 传输结束0000 0101 5 05 ENQ (enquiry) 请求0000 0110 6 06 ACK (acknowledge) 收到通知0000 0111 7 07 BEL (bell) 响铃0000 1000 8 08 BS (backspace) 退格0000 1001 9 09 HT (horizontal tab) 水平制表符0000 1010 10 0A LF (NL line feed, new line) 换行键0000 1011 11 0B VT (vertical tab) 垂直制表符0000 1100 12 0C FF (NP form feed, new page) 换页键0000 1101 13 0D CR (carriage return) 回车键0000 1110 14 0E SO (shift out) 不用切换0000 1111 15 0F SI (shift in) 启用切换0001 0000 16 10 DLE (data link escape) 数据链路转义0001 0001 17 11 DC1 (device control 1) 设备控制1 0001 0010 18 12 DC2 (device control 2) 设备控制20001 0011 19 13 DC3 (device control 3) 设备控制3 0001 0100 20 14 DC4 (device control 4) 设备控制4 0001 0101 21 15 NAK (negative acknowledge) 拒绝接收0001 0110 22 16 SYN (synchronous idle) 同步空闲0001 0111 23 17 ETB (end of trans. block) 传输块结束0001 1000 24 18 CAN (cancel) 取消0001 1001 25 19 EM (end of medium) 介质中断0001 1010 26 1A SUB (substitute) 替补0001 1011 27 1B ESC (escape) 溢出0001 1100 28 1C FS (file separator) 文件分割符0001 1101 29 1D GS (group separator) 分组符0001 1110 30 1E RS (record separator) 记录分离符0001 1111 31 1F US (unit separator) 单元分隔符0010 0000 32 20 空格0010 0001 33 21 !0010 0010 34 22 "0010 0011 35 23 #0010 0100 36 24 $0010 0101 37 25 %0010 0110 38 26 &0010 0111 39 27 '0010 1000 40 28 (0010 1010 42 2A * 0010 1011 43 2B + 0010 1100 44 2C , 0010 1101 45 2D - 0010 1110 46 2E . 0010 1111 47 2F / 0011 0000 48 30 0 0011 0001 49 31 1 0011 0010 50 32 2 0011 0011 51 33 3 0011 0100 52 34 4 0011 0101 53 35 5 0011 0110 54 36 6 0011 0111 55 37 7 0011 1000 56 38 8 0011 1001 57 39 9 0011 1010 58 3A : 0011 1011 59 3B ; 0011 1100 60 3C < 0011 1101 61 3D = 0011 1110 62 3E >0100 0000 64 40 @0100 0001 65 41 A 0100 0010 66 42 B 0100 0011 67 43 C 0100 0100 68 44 D 0100 0101 69 45 E 0100 0110 70 46 F 0100 0111 71 47 G 0100 1000 72 48 H 0100 1001 73 49 I 0100 1010 74 4A J 0100 1011 75 4B K 0100 1100 76 4C L 0100 1101 77 4D M 0100 1110 78 4E N 0100 1111 79 4F O 0101 0000 80 50 P 0101 0001 81 51 Q 0101 0010 82 52 R 0101 0011 83 53 S0101 0101 85 55 U 0101 0110 86 56 V 0101 0111 87 57 W 0101 1000 88 58 X 0101 1001 89 59 Y 0101 1010 90 5A Z 0101 1011 91 5B [ 0101 1100 92 5C \ 0101 1101 93 5D ] 0101 1110 94 5E ^ 0101 1111 95 5F _ 0110 0000 96 60 ` 0110 0001 97 61 a 0110 0010 98 62 b 0110 0011 99 63 c 0110 0100 100 64 d 0110 0101 101 65 e 0110 0110 102 66 f 0110 0111 103 67 g 0110 1000 104 68 h 0110 1001 105 69 i0110 1011 107 6B k0110 1100 108 6C l0110 1101 109 6D m0110 1110 110 6E n0110 1111 111 6F o0111 0000 112 70 p0111 0001 113 71 q0111 0010 114 72 r0111 0011 115 73 s0111 0100 116 74 t0111 0101 117 75 u0111 0110 118 76 v0111 0111 119 77 w0111 1000 120 78 x0111 1001 121 79 y0111 1010 122 7A z0111 1011 123 7B {0111 1100 124 7C |0111 1101 125 7D }0111 1110 126 7E ~0111 1111 127 7F DEL (delete) 删除键盘常用ASCII码(十进制表示值)ESC键VK_ESCAPE (27)回车键:VK_RETURN (13)TAB键:VK_TAB (9)Caps Lock键:VK_CAPITAL (20)Shift键:VK_SHIFT (16)Ctrl键:VK_CONTROL (17)Alt键:VK_MENU (18)空格键:VK_SPACE (/32)退格键:VK_BACK (8)左徽标键:VK_LWIN (91)右徽标键:VK_LWIN (92)鼠标右键快捷键:VK_APPS (93)Insert键:VK_INSERT (45)Home键:VK_HOME (36)Page Up:VK_PRIOR (33)PageDown:VK_NEXT (34)End键:VK_END (35)Delete键:VK_DELETE (46)方向键(←):VK_LEFT (37)方向键(↑):VK_UP (38)方向键(→):VK_RIGHT (39)方向键(↓):VK_DOWN (40)F1键:VK_F1 (112)F2键:VK_F2 (113)F3键:VK_F3 (114)F4键:VK_F4 (115)F5键:VK_F5 (116)F6键:VK_F6 (117)F7键:VK_F7 (118)F8键:VK_F8 (119)F9键:VK_F9 (120)F10键:VK_F10 (121)F11键:VK_F11 (122)F12键:VK_F12 (123)Num Lock键:VK_NUMLOCK (144)小键盘0:VK_NUMPAD0 (96)小键盘1:VK_NUMPAD0 (97)小键盘2:VK_NUMPAD0 (98)小键盘3:VK_NUMPAD0 (99)小键盘4:VK_NUMPAD0 (100)小键盘5:VK_NUMPAD0 (101)小键盘6:VK_NUMPAD0 (102)小键盘7:VK_NUMPAD0 (103)小键盘8:VK_NUMPAD0 (104)小键盘9:VK_NUMPAD0 (105)小键盘.:VK_DECIMAL (110)小键盘*:VK_MULTIPLY (106)小键盘+:VK_MULTIPLY (107)小键盘-:VK_SUBTRACT (109)小键盘/:VK_DIVIDE (111)Pause Break键:VK_PAUSE (19)Scroll Lock键:VK_SCROLL (145)Bin二进Dec十进Hex十六进缩写/字符解释00000000000 NUL(null)空字符00000001101SOH(start of handling)标题开始常见ASCII码的大小规则:0~9<A~Z<a~z1)数字比字母要小。
as3.0键盘控制代码
as3.0键盘控制代码键盘控制单一键键盘控制的通用代码stage.addEventListener(KeyboardEvent.KEY_DOWN,playpau seMC);function playpauseMC(event:KeyboardEvent):void {switch (event.keyCode) {case Keyboard.SPACE ://上面除了SPACE,像UP、DOWN、L EFT、RIGHT、SHIFT也行。
Movieclip.xxx;// Movieclip.xxx是影片剪辑的执行命令,如 Movieclip.stop();break;default :break;}}比如,用键盘控制播放与暂停空格键控制影片剪辑播放与暂停stage.addEventListener(KeyboardEvent.KEY_DOWN,playpau seMC);function playpauseMC(event:KeyboardEvent):void {switch (event.keyCode) {case Keyboard.SPACE ://下面是让this.id这个值和上一次的不同简单的说就是在True和False之间来回切换this.id=!this.id;//这是用到?:运算符如果this.id为真,则执行":"号前面的语句,即mc.stop(); 如假则执行后面的语句,即mc.stop();this.id ?jiewen.stop(): jiewen.play();break;default :break;}}还可以用组合键来控制动作,代码如下:stage.addEventListener(KeyboardEvent.KEY_DOWN,playpau seMC);//给舞台stage添加键盘按下执行playpauseMC函数的侦听function playpauseMC(event:KeyboardEvent):void {if (event.ctrlKey && event.keyCode == Keyboard.SHIFT) {//当执行playpauseMC函数时按下的是组合键CTRL和SHIFT,启动以下命令this.id=!this.id;//上面是让this.id这个值和上一次的不同简单的说就是在True和False之间来回切换 this.id ?jiewen.stop(): jiewen.play();//这是用到?:运算符如果this.id为真,则执行":"号前面的语句,即mc.stop(); 如假则执行后面的语句,即mc.stop();}}除了SHIFT之外,DELETE、END HOME、INSERT、PAGE_UP、PAGE_DOWN、LEFT、 RIGHT 也可以用。
最全ASCII对应码表-键值
最全ASCII对应码表-键值OCT(八进制)最全ASCII码对应表—与键盘按键对应值(二进)Bin (十进)Dec (十六进)Hex 缩写/字符解释0000 0000 0 00 NUL (null)空字符0000 0001 1 01 SOH (start o f handing) 标题开始0000 0010 2 02 STX (start o f text) 正文开始0000 0011 3 03 ETX (end of text) 正文结束0000 0100 4 04 EOT (end of transmission) 传输结束0000 0101 5 05 ENQ (enquir y) 请求0000 0110 6 06 ACK (acknowl edge) 收到通知0000 0111 7 07 BEL (bell)响铃0000 1000 8 08 BS (backspac e) 退格0000 1001 9 09 HT (horizont al tab) 水平制表符0000 1010 10 0A LF (NL line fee d, new line) 换行键0000 1011 11 0B VT (vertical ta b) 垂直制表符0000 1100 12 0C FF (NP form fee d, new page) 换页键0000 1101 13 0D CR (carriage re turn) 回车键0000 1110 14 0E SO (shift out) 不用切换0000 1111 15 0F SI (shift in) 启用切换0001 0000 16 10 DLE (data link escape) 数据链路转义0001 0001 17 11 DC1 (device con trol 1) 设备控制10001 0010 18 12 DC2 (device con trol 2) 设备控制2 0001 0011 19 13 DC3 (device con trol 3) 设备控制3 0001 0100 20 14 DC4 (device con trol 4) 设备控制4 0001 0101 21 15 NAK (negative a cknowledge) 拒绝接收0001 0110 22 16 SYN (synchronou s idle) 同步空闲0001 0111 23 17 ETB (end of tra ns. block) 传输块结束0001 1000 24 18 CAN (cancel) 取消0001 1001 25 19 EM (end of medi um) 介质中断0001 1010 26 1A SUB (substitut e) 替补0001 1011 27 1B ESC (escape) 溢出0001 1100 28 1C FS (file separa tor) 文件分割符0001 1101 29 1D GS (group separ ator) 分组符0001 1110 30 1E RS (record sepa rator) 记录分离符0001 1111 31 1F US (unit separa tor) 单元分隔符0010 0000 32 20 空格0010 0001 33 21 !0010 0010 34 22 "0010 0011 35 23 #0010 0100 36 24 $0010 0101 37 25 %0010 0110 38 26 &0010 0111 39 27 '0010 1000 40 28 (0010 1001 41 29 )0010 1010 42 2A *0010 1011 43 2B +0010 1100 44 2C ,0010 1101 45 2D -0010 1110 46 2E .0010 1111 47 2F /0011 0001 49 31 1 0011 0010 50 32 2 0011 0011 51 33 3 0011 0100 52 34 4 0011 0101 53 35 5 0011 0110 54 36 6 0011 0111 55 37 7 0011 1000 56 38 8 0011 1001 57 39 9 0011 1010 58 3A : 0011 1011 59 3B ; 0011 1100 60 3C < 0011 1101 61 3D = 0011 1110 62 3E > 0011 1111 63 3F ? 0100 0000 64 400100 0001 65 41 A 0100 0010 66 42 B 0100 0011 67 43 C 0100 0100 68 44 D0100 0110 70 46 F 0100 0111 71 47 G 0100 1000 72 48 H 0100 1001 73 49 I 0100 1010 74 4A J 0100 1011 75 4B K 0100 1100 76 4C L 0100 1101 77 4D M 0100 1110 78 4E N 0100 1111 79 4F O 0101 0000 80 50 P 0101 0001 81 51 Q 0101 0010 82 52 R 0101 0011 83 53 S 0101 0100 84 54 T 0101 0101 85 55 U 0101 0110 86 56 V 0101 0111 87 57 W 0101 1000 88 58 X 0101 1001 89 59 Y 0101 1010 90 5A Z。
键盘ASCII码值对照表
键盘ASCII码值对照表键盘ASCII码值对照表0x1 鼠标左键0x2 鼠标右键0x3 CANCEL 键0x4 鼠标中键0x8 BACKSPACE 键0x9 TAB 键0xC CLEAR 键0xD ENTER 键0x10 SHIFT 键0x11 CTRL 键0x12 MENU 键0x13 PAUSE 键0x14 CAPS LOCK 键0x1B ESC 键0x20 SPACEBAR 键0x21 PAGE UP 键0x22 PAGE DOWN 键0x23 END 键0x24 HOME 键0x25 LEFT ARROW 键0x26 UP ARROW 键0x27 RIGHT ARROW 键0x28 DOWN ARROW 键0x29 SELECT 键0x2A PRINT SCREEN 键0x2B EXECUTE 键0x2C SNAPSHOT 键0x2D INSERT 键0x2E DELETE 键0x2F HELP 键0x90 NUM LOCK 键====================================大小写字母的 ASCII 码相同:值描述65 A 键66 B 键67 C 键68 D 键69 E 键70 F 键72 H 键73 I 键74 J 键75 K 键76 L 键77 M 键78 N 键79 O 键80 P 键81 Q 键82 R 键83 S 键84 T 键85 U 键86 V 键87 W 键88 X 键89 Y 键90 Z 键===================================0 至 9 键的 ASCII 码:值描述48 0 键49 1 键50 2 键51 3 键52 4 键53 5 键54 6 键55 7 键56 8 键57 9 键===================================下列常数代表数字键盘上的键:值描述0x60 0 键0x61 1 键0x62 2 键0x63 3 键0x65 5 键0x66 6 键0x67 7 键0x68 8 键0x69 9 键0x6A MULTIPLICATION SIGN (*) 键0x6B PLUS SIGN (+) 键0x6C ENTER 键0x6D MINUS SIGN (–) 键0x6E DECIMAL POINT (.) 键0x6F DIVISION SIGN (/) 键====================================下列常数代表功能键:值描述0x70 F1 键0x71 F2 键0x72 F3 键0x73 F4 键0x74 F5 键0x75 F6 键0x76 F7 键0x77 F8 键0x78 F9 键0x79 F10 键0x7A F11 键0x7B F12 键0x7C F13 键0x7D F14 键0x7E F15 键0x7F F16 键====================================ASCII 码对照表Char Dec Oct Hex | Char Dec Oct Hex | Char Dec Oct Hex |Char Dec Oct Hex-------------------------------------------------------------------------------------(nul) 0 0000 0x00 | (sp) 32 0040 0x20 | @ 64 0100 0x40 | ` 96 0140 0x60(soh) 1 0001 0x01 | ! 33 0041 0x21 | A 65 0101 0x41 | a 97 0141 0x610142 0x62(etx) 3 0003 0x03 | # 35 0043 0x23 | C 67 0103 0x43 | c 99 0143 0x63(eot) 4 0004 0x04 | $ 36 0044 0x24 | D 68 0104 0x44 | d 100 0144 0x64(enq) 5 0005 0x05 | % 37 0045 0x25 | E 69 0105 0x45 | e 101 0145 0x65(ack) 6 0006 0x06 | & 38 0046 0x26 | F 70 0106 0x46 | f 102 0146 0x66(bel) 7 0007 0x07 | ' 39 0047 0x27 | G 71 0107 0x47 | g 103 0147 0x67(bs) 8 0010 0x08 | ( 40 0050 0x28 | H 72 0110 0x48 | h 104 0150 0x68(ht) 9 0011 0x09 | ) 41 0051 0x29 | I 73 0111 0x49 | i 105 0151 0x69(nl) 10 0012 0x0a | * 42 0052 0x2a | J 74 0112 0x4a | j 106 0152 0x6a(vt) 11 0013 0x0b | + 43 0053 0x2b | K 75 0113 0x4b | k 107 0153 0x6b(np) 12 0014 0x0c | , 44 0054 0x2c | L 76 0114 0x4c | l 108 0154 0x6c(cr) 13 0015 0x0d | - 45 0055 0x2d | M 77 0115 0x4d | m 1090155 0x6d(so) 14 0016 0x0e | . 46 0056 0x2e | N 78 0116 0x4e | n 110 0156 0x6e(si) 15 0017 0x0f | / 47 0057 0x2f | O 79 0117 0x4f | o 111 0157 0x6f(dle) 16 0020 0x10 | 0 48 0060 0x30 | P 80 0120 0x50 | p 112 0160 0x70(dc1) 17 0021 0x11 | 1 49 0061 0x31 | Q 81 0121 0x51 | q 113 0161 0x71(dc2) 18 0022 0x12 | 2 50 0062 0x32 | R 82 0122 0x52 | r 114 0162 0x72(dc3) 19 0023 0x13 | 3 51 0063 0x33 | S 83 0123 0x53 | s 115 0163 0x73(dc4) 20 0024 0x14 | 4 52 0064 0x34 | T 84 0124 0x54 | t 116 0164 0x74(nak) 21 0025 0x15 | 5 53 0065 0x35 | U 85 0125 0x55 | u 117 0165 0x75(syn) 22 0026 0x16 | 6 54 0066 0x36 | V 86 0126 0x56 | v 118 0166 0x76(etb) 23 0027 0x17 | 7 55 0067 0x37 | W 87 0127 0x57 | w 119 0167 0x770170 0x78(em) 25 0031 0x19 | 9 57 0071 0x39 | Y 89 0131 0x59 | y 121 0171 0x79(sub) 26 0032 0x1a | : 58 0072 0x3a | Z 90 0132 0x5a | z 122 0172 0x7a(esc) 27 0033 0x1b | ; 59 0073 0x3b | [ 91 0133 0x5b | { 123 0173 0x7b(fs) 28 0034 0x1c | < 60 0074 0x3c | \ 92 0134 0x5c | | 124 0174 0x7c(gs) 29 0035 0x1d | = 61 0075 0x3d | ] 93 0135 0x5d | } 125 0175 0x7d(rs) 30 0036 0x1e | > 62 0076 0x3e | ^ 94 0136 0x5e | ~ 126 0176 0x7e(us) 31 0037 0x1f | ? 63 0077 0x3f | _ 95 0137 0x5f | (del) 127 0177 0x7f====================================常数值描述vbKeyLButton 1 鼠标左键vbKeyRButton 2 鼠标右键vbKeyCancel 3 CANCELvbKeyMButton 4 鼠标中键vbKeyBack 8 BACKSPACEvbKeyTab 9 TABvbKeyClear 12 CLEARvbKeyReturn 13 ENTERvbKeyShift 16 SHIFTvbKeyControl 17 CTRLvbKeyMenu 18 菜单键vbKeyPause 19 PAUSEvbKeyCapital 20 CAPS LOCKvbKeyEscape 27 ESCvbKeySpace 32 SPACEBARvbKeyPageUp 33 PAGEUPvbKeyPageDown 34 PAGEDOWNvbKeyEnd 35 ENDvbKeyHome 36 HOMEvbKeyLeft 37 LEFT ARROWvbKeyUp 38 UP ARROWvbKeyRight 39 RIGHT ARROWvbKeyDown 40 DOWN ARROWvbKeySelect 41 SELECT vbKeyPrint 42 PRINT SCREEN vbKeyExecute 43 EXECUTE vbKeySnapshot 44 SNAP SHOT vbKeyInser 45 INS vbKeyDelete 46 DEL vbKeyHelp 47 HELP vbKeyNumlock 144 NUM LOCKvbKeyA 65 AvbKeyB 66 BvbKeyC 67 CvbKeyD 68 DvbKeyE 69 EvbKeyF 70 FvbKeyG 71 GvbKeyH 72 HvbKeyI 73 IvbKeyJ 74 JvbKeyK 75 KvbKeyL 76 LvbKeyM 77 MvbKeyN 78 NvbKeyO 79 OvbKeyP 80 PvbKeyQ 81 QvbKeyR 82 RvbKeyS 83 SvbKeyT 84 TvbKeyU 85 UvbKeyV 86 VvbKeyW 87 WvbKeyX 88 XvbKeyY 89 YvbKeyZ 90 ZvbKey0 48 0vbKey1 49 1vbKey2 50 2vbKey3 51 3vbKey4 52 4vbKey5 53 5vbKey6 54 6vbKey7 55 7vbKey8 56 8vbKey9 57 9数字小键盘上的键vbKeyNumpad0 96 0vbKeyNumpad1 97 1vbKeyNumpad2 98 2vbKeyNumpad3 99 3vbKeyNumpad4 100 4vbKeyNumpad5 101 5vbKeyNumpad6 102 6vbKeyNumpad7 103 7vbKeyNumpad8 104 8vbKeyNumpad9 105 9vbKeyMultiply 106 乘号(*)vbKeyAdd 107 加号(+)vbKeySeparator 108 ENTER(在数字小键盘上)vbKeySubtract 109 减号(-)vbKeyDecimal 110 小数点(.)vbKeyDivide 111 除号(/)功能键vbKeyF1 112 F1vbKeyF2 113 F2vbKeyF3 114 F3vbKeyF4 115 F4vbKeyF5 116 F5vbKeyF6 117 F6vbKeyF7 118 F7vbKeyF8 119 F8vbKeyF9 120 F9vbKeyF10 121 F10vbKeyF11 122 F11vbKeyF12 123 F12vbKeyF13 124 F13vbKeyF14 125 F14 vbKeyF15 126 F15 vbKeyF16 127 F16。
FLASH-as3.0常用代码
FLASH as3.0常用代码1.按钮事件(新版)步骤:实现第一帧暂停:右击第一帧,点动作,写代码stop();实现点按钮开始:放一个按钮(可以在窗口菜单->公用库->按钮里找一个)在第一帧的舞台上,属性面板里给按钮取名:实例名称bt1 ,右击第一帧,点动作,写代码:bt1.addEventListener(MouseEvent.CLICK ,f1); function f1(evt:MouseEvent){gotoAndPlay(2);}//////////////////////////补充:as2(老版)中的按钮事件实现第一帧暂停:右击第一帧,点动作,写代码stop();实现点按钮开始:放一个按钮(可以在窗口菜单->公用库->按钮里找一个)在第一帧的舞台上,右击按钮,点动作,写代码:on (release){ gotoAndPlay(2); }//////////////////////////2.按钮超链接linkButton.addEventListener(MouseEvent.CLICK, gotoAdobeSite);function gotoAdobeSite(event:MouseEvent):void {var adobeURL:URLRequest = new URLRequest("");navigateToURL(adobeURL);}3.随机数Math.random ()输出时间var time1:Date=new Date(); t1.text=time1.toLocaleTimeString(); 4.画线1graphics.lineStyle(3,0xff0000,0.3);graphics.moveTo(300,100);graphics.lineTo(200,300);画线2graphics.lineStyle(1,0xff0000,1);for(var i:int=0;i<100;i++){graphics.lineTo(Math.random()*600,Math.random ()*400);}5. 画三角形var m1:MovieClip = new(MovieClip); //声明一个新的mc类bt1,并用new来构造它m1.graphics.lineStyle(2, 0x990000, .75);//使用bt1的graphics属性设置线条粗细,颜色,透明度m1.graphics.beginFill(0x00FF00);//以下的代码是用graphics画三角形。
键盘ASCII码映射
键盘ASCII码映射键盘KeyCodekeycode 0 =keycode 1 =keycode 2 =keycode 3 =keycode 4 =keycode 5 =keycode 6 =keycode 7 =keycode 8 = BackSpace BackSpace keycode 9 = Tab Tab keycode 10 =keycode 11 =keycode 12 = Clearkeycode 13 = Enterkeycode 14 =keycode 15 =keycode 16 = Shift_Lkeycode 17 = Control_L keycode 18 = Alt_Lkeycode 19 = Pausekeycode 20 = Caps_Lock keycode 21 =keycode 22 =keycode 23 =keycode 24 =keycode 25 =keycode 26 =keycode 27 = Escape Escape keycode 28 =keycode 29 =keycode 30 =keycode 31 =keycode 32 = space space keycode 33 = Priorkeycode 34 = Nextkeycode 35 = Endkeycode 36 = Homekeycode 37 = Leftkeycode 38 = Upkeycode 39 = Rightkeycode 40 = Downkeycode 42 = Printkeycode 43 = Executekeycode 44 =keycode 45 = Insertkeycode 46 = Deletekeycode 47 = Helpkeycode 48 = 0 equal braceright keycode 49 = 1 exclam onesuperior keycode 50 = 2 quotedbl twosuperior keycode 51 = 3 section threesuperior keycode 52 = 4 dollarkeycode 53 = 5 percentkeycode 54 = 6 ampersandkeycode 55 = 7 slash braceleft keycode 56 = 8 parenleft bracketleft keycode 57 = 9 parenright bracketright keycode 58 = keycode 59 =keycode 60 =keycode 61 =keycode 62 =keycode 63 =keycode 64 =keycode 65 = a A keycode 66 = b B keycode 67 = c C keycode 68 = d D keycode 69 = e E EuroSign keycode 70 = f F keycode 71 = g G keycode 72 = h H keycode 73 = i I keycode 74 = j J keycode 75 = k K keycode 76 = l L keycode 77 = m M mu keycode 78 = n N keycode 79 = o O keycode 80 = p P keycode 81 = q Q at keycode 82 = r R keycode 83 = s S keycode 84 = t T keycode 86 = v V keycode 87 = w W keycode 88 = x X keycode 89 = y Y keycode 90 = z Z keycode 91 =keycode 92 =keycode 93 =keycode 94 =keycode 95 =keycode 96 = KP_0 KP_0keycode 97 = KP_1 KP_1keycode 98 = KP_2 KP_2keycode 99 = KP_3 KP_3keycode 100 = KP_4 KP_4keycode 101 = KP_5 KP_5keycode 102 = KP_6 KP_6keycode 103 = KP_7 KP_7keycode 104 = KP_8 KP_8keycode 105 = KP_9 KP_9keycode 106 = KP_Multiply KP_Multiply keycode 107 = KP_Add KP_Add keycode 108 = KP_Separator KP_Separator keycode 109 = KP_Subtract KP_Subtract keycode 110 = KP_Decimal KP_Decimal keycode 111 = KP_Divide KP_Divide keycode 112 = F1keycode 113 = F2keycode 114 = F3keycode 115 = F4keycode 116 = F5keycode 117 = F6keycode 118 = F7keycode 119 = F8keycode 120 = F9keycode 121 = F10keycode 122 = F11keycode 123 = F12keycode 124 = F13keycode 125 = F14keycode 126 = F15keycode 127 = F16keycode 128 = F17keycode 130 = F19 keycode 131 = F20 keycode 132 = F21 keycode 133 = F22 keycode 134 = F23 keycode 135 = F24 keycode 136 = Num_Lock keycode 137 = Scroll_Lock keycode 138 =keycode 139 =keycode 140 =keycode 141 =keycode 142 =keycode 143 =keycode 144 =keycode 145 =keycode 146 =keycode 147 =keycode 148 =keycode 149 =keycode 150 =keycode 151 =keycode 152 =keycode 153 =keycode 154 =keycode 155 =keycode 156 =keycode 157 =keycode 158 =keycode 159 =keycode 160 =keycode 161 =keycode 162 =keycode 163 =keycode 165 =keycode 166 =keycode 167 =keycode 168 =keycode 169 =keycode 170 =keycode 171 =keycode 172 =keycode 173 =keycode 174 =keycode 175 =keycode 176 =keycode 177 =keycode 178 =keycode 179 =keycode 180 =keycode 181 =keycode 182 =keycode 183 =keycode 184 =keycode 185 =keycode 186 =keycode 187 = acute gravekeycode 188 = comma semicolon keycode 189 = minus underscore keycode 190 = period colonkeycode 191 =keycode 192 = numbersign apostrophe keycode 193 =keycode 194 =keycode 195 =keycode 197 =keycode 198 =keycode 199 =keycode 200 =keycode 201 =keycode 202 =keycode 203 =keycode 204 =keycode 205 =keycode 206 =keycode 207 =keycode 208 =keycode 209 =keycode 210 = plusminus hyphen macron keycode 211 =keycode 212 = copyright registered keycode 213 = guillemotleft guillemotright keycode 214 = masculine ordfeminine keycode 215 = ae AEkeycode 216 = cent yenkeycode 217 = questiondown exclamdown keycode 218 = onequarter onehalf threequarters keycode 219 =keycode 220 = less greater barkeycode 221 = plus asterisk asciitilde keycode 222 =keycode 223 =keycode 224 =keycode 225 =keycode 226 =keycode 227 = multiply divisionkeycode 228 = acircumflex Acircumflex keycode 229 = ecircumflex Ecircumflex keycode 230 = icircumflex Icircumflexkeycode 231 = ocircumflex Ocircumflex keycode 232 = ucircumflex Ucircumflex keycode 233 = ntilde Ntilde keycode 234 = yacute Y acutekeycode 235 = oslash Oobliquekeycode 236 = aring Aringkeycode 237 = ccedilla Ccedillakeycode 238 = thorn THORNkeycode 239 = eth ETHkeycode 240 = diaeresis cedilla currency keycode 241 = agrave Agrave atilde Atilde keycode 242 = egrave Egrave keycode 243 = igrave Igravekeycode 244 = ograve Ograve otilde Otilde keycode 245 = ugrave Ugravekeycode 246 = adiaeresis Adiaeresiskeycode 247 = ediaeresis Ediaeresiskeycode 248 = idiaeresis Idiaeresiskeycode 249 = odiaeresis Odiaeresiskeycode 250 = udiaeresis Udiaeresiskeycode 251 = ssharp question backslash keycode 252 = asciicircum degreekeycode 253 = 3 sterlingkeycode 254 = Mode_switch。
键盘按键对应的ASCII码值
End键: VK_END (35)
Delete键: VK_DELETE (46)
方向键(←): VK_LEFT (37)
方向键(↑): VK_UP (38)
方向键(→): VK_RIGHT (39)
方向键(↓): VK_DOWN (40)
F1键: VK_F1 (112)
F12键: VK_F12 (123)
Num Lock键: VK_NUMLOCK (144)
小键盘0: VK_NUMPAD0 (96)
小键盘1: VK_NUMPAD0 (97)
小键盘2: VK_NUMPAD0 (98)
小键盘3: VK_NUMPAD0 (99)
小键盘4: VK_NUMPAD0 (100)
键盘常用ASCII码
ESC键 VK_ESCAPE (27)
回车键: VK_RETURN (13)
TAB键: VK_TAB (9)
Caps Lock键: VK_CAPITAL (20)
Shift键: VK_SHIFT ($10)
Ctrl键: VK_CONTROL (17)
Alt键: VK_MENU (18)
小键盘5: VK_NUMPAD0 (101)
小键盘6: VK_NUMPAD0 (102)
小键盘7: VK_NUMPAD0 (103)
小键盘8: VK_NUMPAD0 (104)
小键盘9: VK_NUMPAD0 (105)
小键盘.: VK_DECIMAL (110)
小键盘*: VK_MULTIPLY (106)
DCI
49
1
81
Q
113
q
18
DC2
Get清风FLASHas3.0常用代码
FLASH-as3.0常用代码1.按钮事件〔新版〕步骤:实现第一帧暂停:右击第一帧,点动作,写代码stop();实现点按钮开始:放一个按钮〔可以在窗口菜单->公用库->按钮里找一个〕在第一帧的舞台上,属性面板里给按钮取名:实例名称bt1 ,右击第一帧,点动作,写代码:bt1.addEventListener(MouseEvent.CLICK ,f1);function f1(evt:MouseEvent){gotoAndPlay(2);}//////////////////////////补充:as2(老版)中的按钮事件实现第一帧暂停:右击第一帧,点动作,写代码stop();实现点按钮开始:放一个按钮〔可以在窗口菜单->公用库->按钮里找一个〕在第一帧的舞台上,右击按钮,点动作,写代码:on (release){ gotoAndPlay(2); }//////////////////////////2.按钮超链接linkButton.addEventListener(MouseEvent.CLICK, gotoAdobeSite);function gotoAdobeSite(event:MouseEvent):void{var adobeURL:URLRequest = new URLRequest("");navigateToURL(adobeURL);}3.随机数Math.random ()输出时间var time1:Date=new Date(); t1.text=time1.toLocaleTimeString();4.画线1graphics.lineStyle(3,0xff0000,0.3);graphics.moveTo(300,100);graphics.lineTo(200,300);画线2graphics.lineStyle(1,0xff0000,1);for(var i:int=0;i<100;i++){graphics.lineTo(Math.random ()*600,Math.random ()*400);}5. 画三角形var m1:MovieClip = new(MovieClip); //声明一个新的mc类bt1,并用new来构造它m1.graphics.lineStyle(2, 0x990000, .75);//使用bt1的graphics属性设置线条粗细,颜色,透明度m1.graphics.beginFill(0x00FF00);//以下的代码是用graphics画三角形。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
AS3.0 KeyCodes键盘代码及keycode对照表
来自: 三二(我的帮助从何而来) 2012-11-06 20:44:16
package {
import flash.display.Sprite;
import flash.ui.Keyboard;
import flash.events.KeyboardEvent;
public class keyCodes extends Sprite {
public function keyCodes() {
init();
}
private function init():void{
var ball = new Sprite();
addChild(ball);
ball.graphics.beginFill(0xFFFF00);
ball.graphics.drawCircle(0,0,100);
ball.graphics.endFill();
ball.x = stage.stageWidth/2;
ball.y = stage.stageHeight/2;
stage.addEventListener(KeyboardEvent.KEY_DOWN,onKeyboardEvent);
function onKeyboardEvent(e:KeyboardEvent){
switch(e.keyCode){
case Keyboard.UP:
ball.y -= 10;
break;
case Keyboard.DOWN:
ball.y += 10;
break;
case Keyboard.LEFT:
ball.x -= 10;
break;
case Keyboard.RIGHT:
ball.x += 10;
break;
default:
break;
}
}
}
}
}
keycode对照表:
字母和数字键的键码值(keyCode)
按键键码按键键码按键键码按键键码
A 65 J 74 S 83 1 49
B 66 K 75 T 84 2 50
C 67 L 76 U 85 3 51
D 68 M 77 V 86 4 52
E 69 N 78 W 87 5 53
F 70 O 79 X 88 6 54
G 71 P 80 Y 89 7 55
H 72 Q 81 Z 90 8 56
I 73 R 82 0 48 9 57
数字键盘上的键的键码值(keyCode) 功能键键码值(keyCode) 按键键码按键键码按键键码按键键码
0 96 8 104 F1 112 F7 118
1 97 9 105 F
2 11
3 F8 119
2 98 * 106 F
3 11
4 F9 120
3 99 + 107 F
4 11
5 F10 121
4 100 Enter 108 F
5 11
6 F11 122
5 101 - 109 F
6 11
7 F12 123
6 102 . 110
7 103 / 111
控制键键码值(keyCode)
按键键码按键键码按键键码按键键码
BackSpace 8 Esc 27 Right Arrow 39 -_ 189
Tab 9 Spacebar 32 Dw Arrow 40 .> 190
Clear 12 Page Up 33 Insert 45 /? 191
Enter 13 Page Down 34 Delete 46 `~ 192
Shift 16 End 35 Num Lock 144 [{ 219
Control 17 Home 36 ;: 186 \| 220
Alt 18 Left Arrow 37 =+ 187 ]} 221
Cape Lock 20 Up Arrow 38 ,< 188 ‘” 222
多媒体键码值(keyCode)
按键键码按键键码按键键码按键键码
音量加175
音量减174
停止179
静音173 浏览器172 邮件180 搜索170 收藏171。