# Path to gotoAndPlay

**URL:** <https://forum.kirupa.com/t/path-to-gotoandplay/192900>\
**Category:** Uncategorized\
**Created:** [July 2, 2006, 3:52pm UTC](https://forum.kirupa.com/t/path-to-gotoandplay/192900 "2006-07-02T15:52:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xzyfer](https://avatars.discourse-cdn.com/v4/letter/x/ce73a5/32.png) [@xzyfer](https://forum.kirupa.com/u/xzyfer)\
**Post date:** [July 2, 2006, 3:52pm UTC](https://forum.kirupa.com/t/path-to-gotoandplay/192900/1 "2006-07-02T15:52:50Z")

</div>

hey guys,

ive got a class which creates a bunch of movie clips on the main time line.

how ever i cant seem to access any of the normal movie clip properties or methods ?!

Board.as

```auto

class Board{
        
        function Board()
        {
                __block = Array(6);
                // initialize all block
                for(var i:Number=0; i < 6; i++)
                {
                        for(var j:Number=0; j < 6; j++)
                        {
                                var blockName:String = "B"+String(j)+String(i);
                                var blockDepth:Number = _root.getNextHighestDepth();
                                var blockType:String = fillSpace();
                                _root.attachMovie(blockType, blockName, blockDepth);
                                _root[blockName].__type = blockType;
                                _root[blockName]._x = j*50+100;
                                _root[blockName]._y = i*50+50;
                                _root[blockName].onRollOut = onRollOutHandler;
                                _root[blockName].onRollOver = onRollOverHandler;
                                _root[blockName].onPress = function() { trace(this._name); };
                        }
                }
        }

```

blocks are created fine and when i click i get the correct block name.

still in Board.as

```auto

function onRollOutHandler():Void {
        gotoAndPlay("rollOut");
}
function onRollOverHandler():Void {
        gotoAndPlay("rollOver");
}

```

if i put a “trace(this)” in the function it displays “\_level0.\<mc Name\>”, so the function is being executed. but the gotoAndPlay isnt

if i place “this” infront of the gotoAndPlay call i get an error  
“There is no method with the name ‘gotoAndPlay’.  
this.gotoAndPlay(“rollOver”);”

please help!!
