# Accessing via an object

**URL:** <https://forum.kirupa.com/t/accessing-via-an-object/318431>\
**Category:** flash\
**Created:** [January 20, 2011, 4:58am UTC](https://forum.kirupa.com/t/accessing-via-an-object/318431 "2011-01-20T04:58:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![glisando](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@glisando](https://forum.kirupa.com/u/glisando)\
**Post date:** [January 20, 2011, 4:58am UTC](https://forum.kirupa.com/t/accessing-via-an-object/318431/1 "2011-01-20T04:58:11Z")

</div>

Hi Guys…

I am trying to access a shared object declared in a certain function, from another function. I am having

difficulty doing so. My code are as follows:

```auto
 
//Constructor code
public function EventTest()
  {
 
 
   var ET:EventTest = new EventTest();
   //..Other code 
   doLocalSO();      
  }
 
 
private function doLocalSO()
  {
 
 
   username_so = SharedObject.getLocal("UserName", "/" );  
   //... Other code
 
   Connection();
  }
 
private function Connection()
  {
 
 
   rtmpGo = "rtmp://compName/projName";
   nc = new NetConnection( );   
   nc.connect(rtmpGo, ET.doLocalSO.username_so) 
 
  }

```

I am getting the following error:  
EventTest.as, Line 69 1120: Access of undefined property ET.

I am bascially trying to acccess ‘username\_so’ in the connection function. Where am I going wrong? Hope someone can advise. Thanks.
