这些先不用管
全屏代码:fscommand("fullscreen", "true");
关闭代码:on(release)
{
fscommand("quit")
}
继续代码:on (release) {play();}
至某帧 :on (press) {
gotoAndPlay(?)
}
方向控制:
onClipEvent (load) {
// 初始化小球的移动速度
speed = 5;//为变量speed赋值为5;
}
onClipEvent (enterFrame) {
//左方向
if (Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)) {
this._x -= speed;//speed自减后赋值给X;
this.gotoAndStop("left_pos");
_root.left_mc.gotoAndStop(2);
} else {
_root.left_mc.gotoAndStop(1);
}
//右方向
if (Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT)) {
this._x += speed;//speed自增后赋值给X;
this.gotoAndStop("right_pos");
_root.right_mc.gotoAndStop(2);
} else {
_root.right_mc.gotoAndStop(1);
}
//上方向
if (Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)) {
this._y -= speed;//speed自减后赋值给Y;
this.gotoAndStop("up_pos");
_root.up_mc.gotoAndStop(2);
} else {
_root.up_mc.gotoAndStop(1);
}
//下方向
if (Key.isDown(Key.DOWN) && !Key.isDown(Key.UP)) {
this._y += speed;//speed自增后赋值给Y;
this.gotoAndStop("down_pos");
_root.down_mc.gotoAndStop(2);
} else {
_root.down_mc.gotoAndStop(1);
}
//一旦小球到了限定范围,重新调整小球的位置到(120,470,30,360//)这个范围内
if (this._y<30) {
this._y = 360;
}
if (this._y>360) {
this._y = 30;
}
if (this._x<120) {
this._x = 470;
}
if (this._x>470) {
this._x = 120;
}
}