[問題]flash程式碼問題(fscommand語法)
程式碼如下:
-----------------------------------
const colors:int = 4;
const x_num:int = 10;
const y_num:int = 10;
var colorNum:int;
for (var i:int = 0; i <= (x_num+1); i++) {
for (var j:int = 0; j <= (y_num+1); j++) {
this["block" + i + "_" + j] = new block_mc();
this["block" + i + "_" + j].x = i * 45;
this["block" + i + "_" + j].y = j * 43;
this["block" + i + "_" + j].bx = i;
this["block" + i + "_" + j].by = j;
this["block" + i + "_" + j].bc = 0;
this["block" + i + "_" + j].gotoAndStop("無方塊");
this.addChild(this["block" + i + "_" + j]);
}
}
for (i=1; i<=x_num; i++) {
this["newBlock" + i] = new block_mc();
this["newBlock" + i].alpha = 0.2;
this["newBlock" + i].x = i * 45;
this["newBlock" + i].y = 480;
this["newBlock" + i].gotoAndStop("無方塊");
this.addChild(this["newBlock" + i]);
}
reset_btn.addEventListener(MouseEvent.CLICK, gameReset);
quit_btn.addEventListener(MouseEvent.CLICK, gameQuit);
function clickBlock(event:MouseEvent) {
var bx:int = event.target.bx;
var by:int = event.target.by;
var bc:int = event.target.bc;
if ( bc > 0 ) {
for (var i:int = 0; i <= (x_num+1); i++) {
for (var j:int = 0; j <= (y_num+1); j++) {
this["temp" + i + "_" + j] = this["block" + i + "_" + j].bc;
}
}
colorNum = 0;
searchBlock(bx,by,bc);
if ( colorNum >=3 ) {
gotoAndPlay("異動更新");
}
}
}
function showButton(event:MouseEvent) {
var bc:int = event.target.bc;
if ( bc > 0 ) {
event.target.buttonMode = true;
}
}
function searchBlock(b_x, b_y, b_c:int) {
colorNum ++;
this["temp" + b_x + "_" + b_y] = 0;
if (this["temp" + (b_x + 1) + "_" + b_y] == b_c) {
searchBlock(b_x + 1, b_y, b_c); // right
}
if (this["temp" + (b_x - 1) + "_" + b_y] == b_c) {
searchBlock(b_x - 1, b_y, b_c); // left
}
if (this["temp" + b_x + "_" + (b_y - 1)] == b_c) {
searchBlock(b_x, b_y - 1, b_c); // up
}
if (this["temp" + b_x + "_" + (b_y + 1)] == b_c) {
searchBlock(b_x, b_y + 1, b_c); // down
}
}
function gameReset(event:MouseEvent) {
gotoAndPlay("遊戲開始");
}
function gameQuit(event:MouseEvent) {
fscommand ("quit");
}
--------------------------------------------
當我按下quit_btn這個按鈕的時候
完全不會關閉視窗
完全沒有反應
跪求高手解決
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.224.245.123
→
04/14 22:33, , 1F
04/14 22:33, 1F
→
04/14 22:33, , 2F
04/14 22:33, 2F
→
04/14 22:35, , 3F
04/14 22:35, 3F
→
04/18 18:33, , 4F
04/18 18:33, 4F
Flash 近期熱門文章
PTT數位生活區 即時熱門文章