There is no method with the name 'NetServices'.
jake <[email protected]>
| Newsgroups | gmane.comp.java.openamf.user |
|---|---|
| Message-ID | <[email protected]> |
Why is it that NetServices can be found by the
compiler when the code is in te .fla file but not when
it is in a class file ?
This class:
[as]
import mx.remoting.NetServices;
class Test
{
private var gatewayPath:String = "";
private var servicePath:String = "";
private var serviceConnection:Object = new Object();
private var serviceObject:Object = new Object();
function Test()
{
this.gatewayPath =
"http://localhost:8080/openamf/gateway";
this.servicePath = "com.jakestone.bm.Test";
this.setServiceObject();
trace("Directory Created");
}
// Methods
function setServiceObject() {
NetServices.setDefaultGatewayURL(this.gatewayPath);
this.serviceConnection =
NetServices.createGatewayConnection();
this.serviceObject =
this.serviceConnection.getService(this.servicePath,
this);
}
function setGatewayPath (gatewayPath) {
this.gatewayPath = gatewayPath;
this.setServiceObject();
trace("gateway: "+this.gatewayPath);
}
function setServicePath(servicePath) {
this.servicePath = servicePath;
this.setServiceObject();
trace("service: "+this.servicePath);
}
function sayHello(msg:String) {
this.setServiceObject();
this.serviceObject.sayHello(msg);
}
}[/as]
creates this compiler error:
--------------------------
**Error**
C:\projects\flashwork\openamf\mytest\Test.as: Line 26:
There is no method with the name 'NetServices'.
NetServices.setDefaultGatewayURL(this.gatewayPath);
---------------------------
If the code is in the .fla file, however, it compiles
just fine.
Any ideas ??????
Jake
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20