3.?[代码]最后是asset/index.html的源代码?????
001
1:? <HTML>
|
002
2:? <HEAD>
|
003
3:????? <TITLE>美羊羊卡丁车</TITLE>
|
004
4:????? <META http-equiv=Content-Type content=text/html charset=GB2312>?
|
005
5:????? <META http-equiv=Expires content=0>
|
006
6:????? <META http-equiv=Cache-Control content=no-cache>
|
007
7:????? <META http-equiv=Pragma content=no-cache>
|
008
8:????? <SCRIPT type=text/javascript>
|
009
9:?????????
|
010
10:?????????function ?startFlashGame(para){
|
011
11:?????????????
|
012
12:???????????? rexseeScreen.setScreenOrientation(para.orientation);?????
|
013
13:?????????????if ?( para.sensor ) {
|
014
14:???????????????? rexseeOrientation.setRate('fastest' );????????????????
|
015
15:???????????????? rexseeOrientation.start();????????????????????????????
|
016
16:???????????? }?else ?{
|
017
17:???????????????? rexseeOrientation.setRate('normal' //将传感器敏感程度设为正常
|
018
18:???????????????? rexseeOrientation.stop();????????????????????????????
|
019
19:???????????? }
|
020
20:???????????? rexseeFlash.clearKeyboard();????????????????????????????
|
021
21:?????????????( para.leftKeyboard ) rexseeFlash.setLeftKeyboard(para.leftKeys,para.leftKeyTheme,para.leftKeyboardStyle,para.leftKeyRowStyle,para.leftKeyStyle,para.leftKeyPressedStyle);???????????
|
022
22:?????????????( para.rightKeyboard ) rexseeFlash.setRightKeyboard(para.rightKeys,para.rightKeyTheme,para.rightKeyboardStyle,para.rightKeyRowStyle,para.rightKeyStyle,para.rightKeyPressedStyle);???
|
023
23:???????????? rexseeFlash.setSwfStyle(para.swfStyle);????????????
|
024
24:???????????? rexseeFlash.show(para.swf,para.dialogStyle);????
|
025
25:???????? }
|
026
26:?????????var ?paraKeyboardVersion = {
|
027
27:???????????????? orientation:?????????????"landscape" ,????????
|
028
28:???????????????? sensor:?????????????????false //是否启用方向传感器
|
029
29:?????????????????
|
030
30:???????????????? leftKeyboard:?????????????//是否启用左键盘
|
031
31:???????????????? leftKeys:?????????????????"" //左键盘的按键,数字序列,同一行按键使用逗号分隔,不同行使用分号分隔,Rexsee自定义按键包括-2,-3,-4,-5,其余按键请参考http://developer.android.com/reference/android/view/KeyEvent.html
|
032
32:???????????????? leftKeyTheme:?????????????//左键盘的样式,字符串,应在asset目录下创建以该字符串命名的文件夹,然后将按键图片(键值.png)放在该文件夹
|
033
33:???????????????? leftKeyboardStyle:?????????//左键盘的样式
|
034
34:???????????????? leftKeyRowStyle:?????????//左键盘中每一行的样式
|
035
35:???????????????? leftKeyStyle:?????????????//左键盘中每个按键的样式
|
036
36:???????????????? leftKeyPressedStyle:?????????//左键盘中每个按键被按下时的样式
|
037
37:?????????????????
|
038
38:???????????????? rightKeyboard:?????????????true 039
|
39:???????????????? rightKeys:?????????????????"-1,-5;-2,62;21,22" 040
|
40:???????????????? rightKeyTheme:?????????????"keyboard/default" 041
|
41:???????????????? rightKeyboardStyle:?????"border-left-width:5px;border-left-color:#aaaaaa+#000000/2;background-color:#000000;" 042
|
42:???????????????? rightKeyRowStyle:?????????043
|
43:???????????????? rightKeyStyle:?????????????044
|
44:???????????????? rightKeyPressedStyle:????045
|
45:?????????????????
|
046
46:???????????????? swfStyle:????????????????047
|
47:?????????????????
|
048
48:???????????????? dialogStyle:?????????????049
|
49:?????????????????
|
050
50:???????????????? swf:?????????????????????"game.swf"
|
051
51:???????? };
|
052
52:?????????paraSensorVersion = {
|
053
53:???????????????? orientation:?????????????054
|
54:???????????????? sensor:?????????????????055
|
55:???????????????? leftKeyboard:?????????????056
|
56:???????????????? leftKeys:?????????????????057
|
57:???????????????? leftKeyTheme:?????????????058
|
58:???????????????? leftKeyboardStyle:?????????059
|
59:???????????????? leftKeyRowStyle:?????????060
|
60:???????????????? leftKeyStyle:?????????????061
|
61:???????????????? leftKeyPressedStyle:?????????062
|
62:???????????????? rightKeyboard:?????????????063
|
63:???????????????? rightKeys:?????????????????"-1;-5;-2;62" 064
|
64:???????????????? rightKeyTheme:?????????????065
|
65:???????????????? rightKeyboardStyle:?????066
|
66:???????????????? rightKeyRowStyle:?????????067
|
67:???????????????? rightKeyStyle:?????????????068
|
68:???????????????? rightKeyPressedStyle:????069
|
69:???????????????? swfStyle:????????????????070
|
70:???????????????? dialogStyle:?????????????071
|
71:???????????????? swf:?????????????????????"game.swf"
|
072
72:???????? };
|
073
73:
|
074
74:???????? window.onRexseeReady =?function (){
|
075
75:?????????????
|
076
76:?????????????( rexseeBuild.getSdk()<8) {
|
077
77:???????????????? alert("对不起,您的手机软件版本太低,不能运行该游戏,请使用Android2.2以上版本运行该游。" );
|
078
78:???????????????? rexseeApplication.quit();
|
079
79:???????????? }
|
080
80:?????????????(!rexseeFlash.isReady()){
|
081
81:???????????????? rexseeDialog.confirm("Adobe Flash Player" "Adobe Flash Player没有安装,无法运行该游戏。是否现在安装?" "现在安装" "退出程序" "javascript:rexseeBrowser.open('http://www.rexsee.com/flash/flashplayer/download.php');rexseeApplication.exit();" "javascript:rexseeApplication.exit();" 082
|
82:???????????? }
|
083
83:???????????? rexseeScreen.setScreenAlwaysOn();??????????????????
|
084
84:???????????? rexseeScreen.setScreenOrientation('portrait' );??????
|
085
85:???????????? rexseeStatusBar.setStyle("visibility:hidden;" );?????
|
086
86:???????????????????? }
|
087
87:???????? window.onAjaxReturned =?(ajaxUrl,response){
|
088
88:???????????? response = unescape(response);
|
089
89:?????????????( ajaxUrl == headerUrl) document.getElementById( "header" ).innerHTML = response;
|
090
90:?????????????else ?( ajaxUrl == footerUrl) document.getElementById( "footer" ).innerHTML = response;
|
091
91:?????????????( ajaxUrl == jsUrl) eval(response);
|
092
92:???????? }
|
093
93:???????? window.onFlashDialogDismissed =?(){
|
094
94:?????????????
|
095
95:???????????? rexseeScreen.setScreenOrientation();????????
|
096
96:???????? }
|
097
97:???????? window.onbeforeunload =?098
|
98:?????????????
|
099
99:???????????? rexseeScreen.setScreenOrientation('auto' );????????????
|
100
100:??????????????? rexseeOrientation.stop();????????????????????????????
|
101
101:??????????? }
|
102
102:???????????
|
103
103:????????????version =? ;
|
104
104:????????????
|
105
105:??????????? window.onKeyboardHelpPressed =?106
|
106:????????????????
|
107
107:????????????????( version ==? "keyboard" ?) alert( "左右键向左或向右,空格键跳跃。" 108
|
108:????????????????"sensor" ?"左右倾斜手机向左或向右,虚拟键盘的空格键跳跃。" );
|
109
109:??????????? }
|