# AS2 OOP: Scope and dinamicly created clips

**URL:** https://forum.kirupa.com/t/as2-oop-scope-and-dinamicly-created-clips/192149
**Category:** flash
**Created:** [June 26, 2006, 4:36pm UTC](https://forum.kirupa.com/t/as2-oop-scope-and-dinamicly-created-clips/192149 "2006-06-26T16:36:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![GizmoWolf](https://avatars.discourse-cdn.com/v4/letter/g/779978/32.png) [@GizmoWolf](https://forum.kirupa.com/u/GizmoWolf)
#### Post date: [June 26, 2006, 4:36pm UTC](https://forum.kirupa.com/t/as2-oop-scope-and-dinamicly-created-clips/192149/1 "2006-06-26T16:36:36Z")

</div>

I was reading tonypa’s tile based game tutorial and tried to translate it to as2 when I realized two things:  
a. I don’t know/remember what the this[stuff].\_property syntax means, I don’t recall seeing [] except in arrays. can someone explain/link to an explanation/name to so I’ll know what to look up.  
b. I don’t know how to scoop my individual tiles. my code is the following:

```auto
 class game{
    var _tileW:Number;
    var _tileH:Number;
    var _mapColumns:Number;
    var _mapRows:Number;
    function game(tileH:Number, tileW:Number){
        this._tileH = tileH;
        this._tileW = tileW;
    }
    private function buildMap(map:Array){
        var i;
        var j;
        var tag;
        _root.createEmptyMovieClip("container", _root.getNextHighestDepth());
        this._mapRows = map.length;
        this._mapColumns = map[0].length;
        for(i=0; i<_mapRows; i++){
            for(j=0; j<_mapColumns; j++){
                tag = "t_"+i+"_"+j;
                _root.container.attachMovie("tile", tag, _root.getNextHighestDepth());
                _root.container.tag._x = _tileW*j;
                _root.container.tag._y = _tileH*i;
                trace(_root.container[tag]._x);
            }
        }
    }
}

```

obviously \_root.container.tag. isn’t the way to get to the tile, so what is?

thanks in advance =)
