There is all sorts of stuff you need to think about when creating the
connection to the gateway. Wheather the swf is in a browser or running
in flash and so on. There is an article on macromedia.com all about this
but basically if the swf is in a browser the default gateway is set to
the Server that the browser is calling, if it is not in a browser the
gateway is set to the default.
The way I do it is set the default then just create the connection with
the location of the CFC on the server, not the server name. i.e. :
#include "NetServices.as"
#include "NetDebug.as"
NetServices.setDefaultGatewayUrl("http://localhost/flashservices/gateway
");
gatewayConnection = NetServices.createGatewayConnection();
serverCall = gatewayConnection.getService("Resources.CFC.send",this);
Not
#include "NetServices.as"
#include "NetDebug.as"
NetServices.setDefaultGatewayUrl("http://localhost/flashservices/gateway
");
gatewayConnection = NetServices.createGatewayConnection();
serverCall =
gatewayConnection.getService("localhost.flashservices.gateway.Resources.
CFC.send",this);
This is slightly different to how paul is doing it but it works fine. I
also don't have to re-compile the swf if I am running it locally, within
flash or from the production server.
Giles Roadnight
http://giles.roadnight.name
-----Original Message-----
From: Paul Johnston [mailto:[EMAIL PROTECTED]]
Sent: 13 December 2002 14:59
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] FlashRemoting & CFMX
> googleService = gateway_conn.getService("library.CFC.googleService",
> this);
Ie for you it's:
googleService =
gateway_conn.getService("flashservices.gateway.googleService", this);
This all comes from the Java engine trying to find the class file (that
is
created when a CF template is called). The Java engine replaces a "/"
in a
URL with a "." and so references the correct class file when it is
called.
Also, Flash is not server side, so it has no knowledge of the server's
file
system. It's effectively just another call that the server has to
handle.
HTH
Paul
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]