PDA

View Full Version : Amp-php + Flash Mx 2004


heyder
12-16-2003, 04:44 PM
I'm trying to use remoting in FLASH MX 2004 using AMF-PHP using the following script but... I'm getting the error listed under the code. Has anybody else had this issue?

// Include the NetServices.as file to allow Remoting
#include "NetServices.as"
// Uncomment the next line to include the NetDebug.as file if you want to enable
// and use the NetConnection Debugger Panel. For deployment make sure you comment it out.
#include "NetDebug.as"
//
// Initiliaze our gateway connection and our service


if (inited == null)
{
inited = true;
NetServices.setDefaultGatewayURL ("http://localhost/remoting/simple_gateway.php");
var conn = NetServices.createGatewayConnection ();
var myService = conn.getService ("ams_data", this);
}




**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 13: There is no method with the name 'setDefaultGatewayURL'.
NetServices.setDefaultGatewayURL ("http://localhost/remoting/simple_gateway.php");

Total ActionScript Errors: 1 Reported Errors: 1

SeanPaul72
12-17-2003, 04:39 PM
heyder,
Iwas having plenty trouble with amfphp, until I changed my absolute path (which I'm sure was correct, to a relative path)

You currently have an absolute path, make it relative and see if the code works.

mfalomir
12-28-2003, 07:28 AM
Hi Heyder,

try this instead

// Include the NetServices.as file to allow Remoting
#include "NetServices.as"
// Uncomment the next line to include the NetDebug.as file if you want to enable
// and use the NetConnection Debugger Panel. For deployment make sure you comment it out.
#include "NetDebug.as"
//
// Initiliaze our gateway connection and our service


if (inited == null)
{
inited = true;
var conn = NetServices.createGatewayConnection ("http://localhost/remoting/simple_gateway.php");
var myService = conn.getService ("ams_data", this);
}

and you will get no AS error...

omnidogg
12-28-2003, 04:26 PM
hi heyder,

the correct method name for setting the default gateway in mx 2004 is

setDefaultGatewayUrl

instead of

setDefaultGatewayURL

that will fix the current error you get but watch out because AMFPHP can be bear to work with for the casual scripter

if youre just beginning i recommend working with 0.5.1 release until you get comfortable with it. its a little easier to work and less buggy than the 0.9 beta

good luck