home *** CD-ROM | disk | FTP | other *** search
- function click_cel(n)
- {
- var i = 0;
- while(i < ymax)
- {
- var j = 0;
- while(j < xmax)
- {
- var mc = eval("mcCel_" + i + "_" + j);
- if(mc.num == n)
- {
- mc.bg.gotoAndStop(2);
- }
- else
- {
- mc.bg.gotoAndStop(1);
- }
- j++;
- }
- i++;
- }
- selected_num = n;
- }
- function input_from_button(cc)
- {
- input_chara(cc);
- }
- function input_chara(cc)
- {
- if(selected_num == 0)
- {
- return undefined;
- }
- var old_cc = 0;
- var i = 0;
- while(i < ymax)
- {
- var j = 0;
- while(j < xmax)
- {
- var mc = eval("mcCel_" + i + "_" + j);
- if(mc.num > 0 && mc.num == selected_num)
- {
- old_cc = mc.cc;
- mc.cc = cc;
- mc.tf.text = cc <= 0 ? "" : String.fromCharCode(cc);
- }
- j++;
- }
- i++;
- }
- eval("mcInput_" + cc).gotoAndStop(2);
- if(old_cc > 0)
- {
- eval("mcInput_" + old_cc).gotoAndStop(1);
- }
- if(check_clear())
- {
- gotoAndStop("clear");
- }
- }
- function check_clear()
- {
- var i;
- var j;
- var c = 0;
- i = 0;
- while(i < ymax)
- {
- j = 0;
- while(j < xmax)
- {
- var cc = question.charCodeAt(c);
- if(cc >= 65)
- {
- var mc = eval("mcCel_" + i + "_" + j);
- if(mc.cc != cc)
- {
- return 0;
- }
- }
- c++;
- j++;
- }
- i++;
- }
- return 1;
- }
- function end_play()
- {
- var i;
- var j;
- i = 0;
- while(i < ymax)
- {
- j = 0;
- while(j < xmax)
- {
- var mc = eval("mcCel_" + i + "_" + j);
- if(mc.num > 0)
- {
- mc.gotoAndStop("str");
- mc.bg.gotoAndStop(1);
- }
- j++;
- }
- i++;
- }
- i = 0;
- while(i < 27)
- {
- var cc = 65 + i;
- eval("mcInput_" + cc)._alpha = 15;
- eval("mcInput_" + cc).bt.enabled = false;
- i++;
- }
- }
- stop();
- question = _root.get_question();
- xmax = 11;
- ymax = 11;
- code_cnt = new Array(100);
- i = 0;
- while(i < 100)
- {
- code_cnt[i] = 0;
- i++;
- }
- c = 0;
- i = 0;
- while(i < ymax)
- {
- j = 0;
- while(j < xmax)
- {
- n = question.charCodeAt(c);
- code_cnt[n]++;
- c++;
- j++;
- }
- i++;
- }
- cel_num = new Array(100);
- i = 0;
- while(i < 100)
- {
- cel_num[i] = 0;
- i++;
- }
- selected_num = 0;
- border = 2;
- switch(_parent.lev)
- {
- case 0:
- border = 6;
- break;
- case 1:
- border = 5;
- break;
- case 2:
- border = 4;
- break;
- case 3:
- border = 3;
- break;
- default:
- border = 2;
- }
- cn = 0;
- c = 0;
- i = 0;
- while(i < ymax)
- {
- j = 0;
- while(j < xmax)
- {
- var mcName = "mcCel_" + i + "_" + j;
- this.attachMovie("mcCelOrg",mcName,c);
- mc = eval(mcName);
- mc._x = j * 40;
- mc._y = i * 40;
- s = question.charAt(c);
- mc.ans = s;
- mc.cc = 0;
- mc.num = 0;
- if(s == "*")
- {
- mc.gotoAndStop("black");
- }
- else
- {
- cc = question.charCodeAt(c);
- if(code_cnt[cc] < border)
- {
- mc.gotoAndStop("str");
- mc.cc = cc;
- }
- else
- {
- if(cel_num[cc] == 0)
- {
- cn++;
- cel_num[cc] = cn;
- }
- mc.num = cel_num[cc];
- mc.gotoAndStop("white");
- }
- }
- c++;
- j++;
- }
- i++;
- }
- w = 42;
- i = 0;
- while(i < 27)
- {
- cc = 65 + i;
- var mcName = "mcInput_" + cc;
- this.attachMovie("mcInputOrg",mcName,c);
- mc = eval(mcName);
- mc._x = Math.floor(i % 3) * w + 460;
- mc._y = Math.floor(i / 3) * w;
- mc.tf.text = String.fromCharCode(cc);
- mc.cc = cc;
- if(i == 26)
- {
- mc._x = 460;
- mc._y = 390;
- mc.cc = 0;
- mc.gotoAndStop(3);
- }
- c++;
- i++;
- }
- i = 0;
- while(i < ymax)
- {
- j = 0;
- while(j < xmax)
- {
- cc = eval("mcCel_" + i + "_" + j).cc;
- if(cc > 0)
- {
- eval("mcInput_" + cc).gotoAndStop(2);
- }
- j++;
- }
- i++;
- }
-