# Creating field of tiles

**URL:** <https://forum.kirupa.com/t/creating-field-of-tiles/212032>\
**Category:** flash\
**Created:** [January 7, 2007, 9:34pm UTC](https://forum.kirupa.com/t/creating-field-of-tiles/212032 "2007-01-07T21:34:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blazes](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@blazes](https://forum.kirupa.com/u/blazes)\
**Post date:** [January 7, 2007, 9:34pm UTC](https://forum.kirupa.com/t/creating-field-of-tiles/212032/1 "2007-01-07T21:34:11Z")

</div>

Basicly this should work just like a non OOP tile game board. It just stacks the tiles on top of each other and never changes the color. So I assume that \_root.cname is the wrong way to referance it. Any ideas?

```auto

//Create beginning variables
var checks_ver:Number = 8;
var checks_hor:Number = 8;

var check_size:Number = 64;
var frame:Number = 2;
//Create board
for(var i = 0; i < checks_hor; i++){
    for(var j = 0; j < checks_ver; j++){
        var ver = check_size*i;
        var hor = check_size*j;
        var cname = "check_"+i+"_"+j;
        _root.attachMovie("checks", cname, i*100+j*2);
        _root.cname._x = 200;
        _root.cname._y = 400;
        _root.cname.gotoAndStop(frame);
        if(frame == 2){
            frame = 1;
        }
        else{
            frame = 2;
        }
    }
}

```
