# This' is not accessible from this scope

**URL:** https://forum.kirupa.com/t/this-is-not-accessible-from-this-scope/212604
**Category:** Uncategorized
**Created:** [January 12, 2007, 1:48pm UTC](https://forum.kirupa.com/t/this-is-not-accessible-from-this-scope/212604 "2007-01-12T13:48:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![am\_developer](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@am\_developer](https://forum.kirupa.com/u/am_developer)
#### Post date: [January 12, 2007, 1:48pm UTC](https://forum.kirupa.com/t/this-is-not-accessible-from-this-scope/212604/1 "2007-01-12T13:48:03Z")

</div>

I am sure there is an easy fix for this problem but I am trying to create a remoting connection from within an AS2 class. I am getting the following error…

Line 50: ‘this’ is not accessible from this scope.  
pc.responder = new RelayResponder(this, “onGetRecords”, “onError”);

If anyone could point me in the right direction. The code so far is as follows:

import mx.remoting._;  
import mx.rpc._;  
import mx.remoting.debug.NetDebug;  
import mx.utils.Delegate;

class com.oop.ContentLoader  
{  
static private var \_\_gatewayUrl:String;  
static private var \_\_service:Service;  
static private var pc:PendingCall;

```
function ContentLoader() {};

//PRIVATE
// ___________________________________________________________________________

static private function loadContent()
{
    __gatewayUrl = "http://www.mydomain.com/flashservices/gateway.php";
    
    __service = new Service(__gatewayUrl, null, 'testService', null , null);
    NetDebug.initialize();
    
    pc = __service.getRecords();
    pc.responder = new RelayResponder(this, "onGetRecords", "onError");
}

static private function onGetRevords(re:ResultEvent)
{
    trace('loaded');
}

```

}
