flash源文件

[复制链接]
查看11 | 回复1 | 2009-6-18 10:37:04 | 显示全部楼层 |阅读模式
找个人给我分析下这些代码都是什么意思
_root.onLoad = function() {
fscommand("showmenu", false);
fscommand("allowscale",false);
gameover = 0;
startgame = 0;
score = 0;
maxnum = 3;
initnum = maxnum;
control = 1;
move = 0;
xrise = 30;
yrise = 0;
this.attachMovie("target", "target1", 50);
for (i=1; i<=maxnum; i++) {
this.attachMovie("square", "square" add i, i);
this["square" add i]._x = 20+i*30;
this["square" add i]._y = 280;
}
randomdisplay();
};
function randomdisplay() {
this["target1"]._x = random(15)*30+50;
this["target1"]._y = random(10)*30+10;
for (i=1; i<=maxnum; i++) {
if (this["square"+i]._x == this["target1"]._x && this["square"+i]._y == this["target1"]._y) {
randomdisplay();
}
}
}
function moving() {
move = 1;
}
_root.onEnterFrame = function() {
allow = 1;
inix = this["square" add maxnum]._x;
iniy = this["square" add maxnum]._y;
if (startgame == 1 and gameover == 0) {
if (Key.isDown(Key.UP) and allow ==1) {
if (control != 4) {

move = 1;

xrise = 0;

yrise = -30;

control = 2;

allow = 0;
}
}
if (Key.isDown(Key.DOWN) and allow == 1) {
if (control != 2) {

move = 1;

xrise = 0;

yrise = 30;

control = 4;

allow = 0;
}
}
if (Key.isDown(Key.RIGHT) and allow == 1) {
if (control != 3) {

move = 1;

xrise = 30;

yrise = 0;

control = 1;

allow = 0;
}
}

回复

使用道具 举报

千问 | 2009-6-18 10:37:04 | 显示全部楼层
真晕了,你这些代码你确定能运行?我复制过来,光"}"就少了好几个,我运行后发现这是什么效果啊???只是把2个库里原件载入到场景复制几个。还有你竟然用and add,这可不是c语言里面,难道这是as4.0语言问世?有没有源文件啊,这样才能知道你是做什么效果呢。 我只能把格式给你修复正确--_root.onLoad = function() { fscommand("showmenu", false); fscommand("allowscale", false); gameover = 0; startgame = 0; score = 0; maxnum = 3; initnum = maxnum...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行