views:

525

answers:

1

Hi, i am new to Action Script and i have the following problem: i have global variable tabName and a button, that changes its value, just like this:

on(release){
    _root.tabName = this._name;
}

and now i want to use String variable tabName to address curtain instance on stage to edit its property (actually, i want to control, which tab on tabcontrol is selected).

is there something like getInstanceByName or similar function? thnx

+1  A: 

You can simply use:

_root[tabName]

To access the movieclip with the instance name contained in the variable tabName.

Of course this is for clips located in the root. You can also do the same for moviclips inside movieclips:

_root.knownMovieClip[stringVariable]
Charlie boy