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');
}
}