# Accessing a class private variable in the main timeline

**URL:** <https://forum.kirupa.com/t/accessing-a-class-private-variable-in-the-main-timeline/322782>\
**Category:** flash\
**Created:** [June 3, 2011, 12:33am UTC](https://forum.kirupa.com/t/accessing-a-class-private-variable-in-the-main-timeline/322782 "2011-06-03T00:33:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zazza](https://avatars.discourse-cdn.com/v4/letter/z/35a633/32.png) [@Zazza](https://forum.kirupa.com/u/Zazza)\
**Post date:** [June 3, 2011, 12:33am UTC](https://forum.kirupa.com/t/accessing-a-class-private-variable-in-the-main-timeline/322782/1 "2011-06-03T00:33:04Z")

</div>

Greetings,  
noob question.

Here’s my main class:

```auto
package 
{
    import flash.external.ExternalInterface;
    
    public class main
    {

        public function main()
        {
        }

        public function check_DVBViewer()
        {

            ExternalInterface.call("check_DVBViewer","test");
            ExternalInterface.addCallback("AutoIT",AutoIT);

        }

        private function AutoIT(my_msg:String)
        {
                // here we get the callback string
        }

    }

}

```

in the timeline I have a dynamic text box named my\_textbox:

```auto
var my_test:main = new main();
my_test.check_DVBViewer();
my_textbox.text = ???????

```

Basically the class waits for the callback variable (my\_msg).  
The problem is: I need to set the dynamic textbox text to my\_msg variable.

How can I access it?  
I know I can access a public var in the timeline with _functioname.variable_ but I can’t define a public var inside a function, right?

Thank you very much for your time.
