all groups > macromedia flash flash remoting > august 2004 >
You're in the

macromedia flash flash remoting

group:

newbie remoting question


newbie remoting question uncle_3than
8/2/2004 1:54:26 PM
macromedia flash flash remoting:
Hi, here's my FLA file

ActionScript:

#include "NetServices.as"
var myURL = "http://localhost:8500/flashservices/gateway";
var myServicePath = "frdg/HelloWorld";
myResult = new Object();
myResult.onResult = function(data){
trace("Data received from Server : " + data);
trace("connection succeed");
}
myResult.onStatus = function(info){
trace(info.description);
}
System.onStatus = myResult.onStatus;

var myServer = NetServices.createGatewayConnection(myURL);
myService = myServer.getService(myServicePath, myResult);
myService.sayHello();


--------------------------------------------------------------------------------
--------------------------
and here's my CFC file
Code:
<cfcomponent>
<cffunction name="sayHello" access="remote" returntype="string">
<cfreturn "HelloWorld from CFC"/>
</cffunction>
</cfcomponent>


I put my cfc file in to coldfusion root/frdg/HelloWorld folder, but when I
call it from Flash, it diesont's how me a thing when it suppose to show me
"HelloWorld"....

and another thing is that it keeps trace out an error says that there's no
"onStatus" property in line "System.onStatus"....

please help this newbie out, I really want to get this remoting thing
working...thank you very much for your time.


Re: newbie remoting question database_monkey
8/5/2004 5:53:25 PM
You have a few things going on here uncle.

1) The path format is incorrect. When specifying the path to a service, use
java notation. In other words, use "." instead of "/". In your case, it should
be "frdg.HelloWorld"

2) When specifying the result handler, the object passed in should have
functions to handle both result and status error messges. I would remove the
System.onStatus line as it is unnecessary.

If you include NetDebug.as, you can open the NetDebugger window and see what's
happening between you and the server. Make sure you don't include this line
once you go to production though, it add's quite a bit to the file size. To
open the Net Debugger, you'll find it under "Other Panels" in the "Window" menu.
AddThis Social Bookmark Button