Re: There is no method with the name 'NetServices'.

"Carlos Rovira" <[email protected]>
Newsgroups gmane.comp.java.openamf.user
Message-ID <[email protected]>
Maybe you don't have downloaded the AS2.0 Flash Remoting classes source c
ode.

If you don't have it, go to the macromedia site and search for th
e zip with the classes.
	
----------------------------- Carlos Rovira -
- www.carlosrovira.com ------------------------------

> De:: jake <jak
[email protected]>
> Para: [email protected]
> Asunto:: 
[Openamf-user] There is no method with the name 'NetServices'.
> BCC: Th
u, 5 May 2005 00:24:51 -0700 (PDT)

> Why is it  that NetServices can b
e 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.re
moting.NetServices;
> 
> 
> class Test
> {
> 
> 
> private var gat
ewayPath:String = "";
> private var servicePath:String = "";
> private 
var serviceConnection:Object = new Object();
> private var serviceObject
:Object = new Object();
> 
> function Test()
> {
>   
>  this.gatewa
yPath =
> "<a href=http://localhost:8080/openamf/gateway>http://localhos
t:8080/openamf/gateway</a>;
>  this.servicePath = "com.jakestone.bm.Test
";
>  this.setServiceObject();
>  trace("Directory Created");
> }
> 

> 
> // Methods
> function setServiceObject() {
>  NetServices.setDef
aultGatewayURL(this.gatewayPath);
>  this.serviceConnection =
> NetServ
ices.createGatewayConnection();
>  this.serviceObject =
> this.serviceC
onnection.getService(this.servicePath,
> this);
> }
> function setGate
wayPath (gatewayPath) {
>  this.gatewayPath = gatewayPath;
>  this.setS
erviceObject();
>  trace("gateway: "+this.gatewayPath);
> }
> 
> func
tion 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 m
ethod with the name 'NetServices'.
>      
> NetServices.setDefaultGate
wayURL(this.gatewayPath);
> ---------------------------
> 
> If the co
de is in the .fla file, however, it compiles
> just fine.
> 
> 
> Any
 ideas   ??????
> 
> 
> Jake
> 
> 
> 
> --------------------------
-----------------------------
> This SF.Net email is sponsored by: NEC I
T 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 <a href=http://
www.necitguy.com/?r=20>http://www.necitguy.com/?r=20</a>_________________
______________________________
> Openamf-user mailing list
> Openamf-us
[email protected]
> https://lists.sourceforge.net/lists/listinfo/
openamf-user

Lycos Mail lanza el nuevo Sistema de Seguridad Protek-on. O
lvídate para siempre de los virus y el correo basura (spam) para siempre. http://mail.lycos.es
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.