# \_root replacement for AS3 for object referencing

**URL:** <https://forum.kirupa.com/t/-root-replacement-for-as3-for-object-referencing/249622>\
**Category:** flash\
**Created:** [January 21, 2008, 2:24am UTC](https://forum.kirupa.com/t/-root-replacement-for-as3-for-object-referencing/249622 "2008-01-21T02:24:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Toiletfreak](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/toiletfreak/32/2923_2.png) [@Toiletfreak](https://forum.kirupa.com/u/Toiletfreak)\
**Post date:** [January 21, 2008, 2:24am UTC](https://forum.kirupa.com/t/-root-replacement-for-as3-for-object-referencing/249622/1 "2008-01-21T02:24:53Z")

</div>

Hello,

I am having some problems with accessing objects on the main timeline.

I am calling this function registerMenuButtons() from a function getDimensions() in AS3:

function getDimensions():void {  
registerMenuButtons();  
}

and registerMenuButtons accesses a textfield in a movieclip on the main timeline:

function registerMenuButtons():void {  
graphics\_gr.start\_txt.text = “start”  
}  
however it seems to be a null object reference, text does not change.

In AS 2 I would have used \_root to reference graphics\_gr.start\_txt.text. However I understand that it does not exist anymore. So I defined a variable called ref = this.root, and when I trace ref.graphics\_gr it gives me "[object] point1. However this does not apply for start\_txt, and instead when i try ref.graphics\_gr.start\_txt it gives me a null reference.

Is there any way to use a similar method like \_root in AS2 to access an MC? Really don’t know what’s the problem, and I am not using any custom Document Class at the moment. Thanks!
