VladBD
04.06.2007, 17:26
начал по мере чтения книг, писать пятнахи...
в исходнике пометил !!! - там не выводит значения, как надо написать
загрузка файла неудалась в любом формате, так что вот код
_root.createEmptyMovieClip("f15th", 0);
//init f15th
f15th.init = function (i,j) {
//создаем массив random
var arr = new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
//создаем cell's
for (x=0;x<=3;x++) {
for (y=1;y<=4;y++) {
this.createTextField("cell"+x*4+y,this.getNextHighestDepth(),0,0,i,i);
var tf=this["cell"+x*4+y];
tf.text="";
tf._x=(y-1)*i+y*j;
tf._y=(x*i+(x+1)*j)+13;
tf.selectable=false;
var tf_fmt:TextFormat = new TextFormat();
tf_fmt.font = "Times New Roman"
tf_fmt.size = 36;
tf_fmt.color = 0x000000;
tf_fmt.align = "center";
tf.setTextFormat(tf_fmt);
}
}
}
//создаем сетку
f15th.drawgrid = function (i,j) {
this.lineStyle(j, 0x000000, 100);
for (var n=0; n<=4; n++) {
this.moveTo(0,n*i+j*n);
this.lineTo(i*4+j*4,n*i+j*n);
this.moveTo(n*i+j*n,0);
this.lineTo(n*i+j*n, i*4+j*4);
}
//!!!
for (var n=1; n<=16; n++) {
this["cell"+n].text=n;
}
}
f15th.init(75,2);
f15th.drawgrid(75,2);
в исходнике пометил !!! - там не выводит значения, как надо написать
загрузка файла неудалась в любом формате, так что вот код
_root.createEmptyMovieClip("f15th", 0);
//init f15th
f15th.init = function (i,j) {
//создаем массив random
var arr = new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
//создаем cell's
for (x=0;x<=3;x++) {
for (y=1;y<=4;y++) {
this.createTextField("cell"+x*4+y,this.getNextHighestDepth(),0,0,i,i);
var tf=this["cell"+x*4+y];
tf.text="";
tf._x=(y-1)*i+y*j;
tf._y=(x*i+(x+1)*j)+13;
tf.selectable=false;
var tf_fmt:TextFormat = new TextFormat();
tf_fmt.font = "Times New Roman"
tf_fmt.size = 36;
tf_fmt.color = 0x000000;
tf_fmt.align = "center";
tf.setTextFormat(tf_fmt);
}
}
}
//создаем сетку
f15th.drawgrid = function (i,j) {
this.lineStyle(j, 0x000000, 100);
for (var n=0; n<=4; n++) {
this.moveTo(0,n*i+j*n);
this.lineTo(i*4+j*4,n*i+j*n);
this.moveTo(n*i+j*n,0);
this.lineTo(n*i+j*n, i*4+j*4);
}
//!!!
for (var n=1; n<=16; n++) {
this["cell"+n].text=n;
}
}
f15th.init(75,2);
f15th.drawgrid(75,2);