all groups > macromedia flash flash remoting > may 2006 >
You're in the

macromedia flash flash remoting

group:

Having a heck of time with Remoting


Having a heck of time with Remoting ips007
5/31/2006 8:05:05 PM
macromedia flash flash remoting:
I create a CFC and the associated actionscript to accessing it using Flash
Remoting and rolled it out in a test envirnoment (ColdfusionMX 6.1) and it all
worked. Take the same thing and run it on a ColdfusionMX 7 Server and it does
nothing.

I have been working in FlashMX Pro 2004 (7.2) I Installed the remoting add-on
( actionscript v1) .

I have since added the actionscript v2 add-on hopeing that was it.

I tried the HelloWorld example from the Coldfusion MX 7 docs ( seems quite
different in the way that is coded) and it does not work on the MX7 server and
on the MX6.1 server I get [object Object ], but nothing else.

I'm Getting really confused now...my orginal AS looked like this...

// Include the Required NetService class files
// Uncomment the following include for debugging purposes only:
// #include "NetDebug.as"
#include "NetServices.as"
#include "DataGlue.as"
// Connect to the Flash Remoting service
if (isGatewayOpen == null) {
isGatewayOpen = true;
// Make the Gateway connection
//GatewayURL is comming from the object tag
NetServices.setDefaultGatewayUrl("<a target=_blank
class=ftalternatingbarlinklarge href="http://localhost/flashservices/gateway");
gatewayConnnection">http://localhost/flashservices/gateway");
gatewayConnnection</a> = NetServices.createGatewayConnection();
// Initialize a variable to contain the data passed back through Flash_CF.cfc
flash_cf = gatewayConnnection.getService("sandbox.testDir.getnews", this);
trace("Connected");
// Access the getPageAll method availble now through flash_cf
flash_cf.getDeptNews();
}

Where as the Hello world looks like this:

import mx.remoting.*;
import mx.services.Log;
import mx.rpc.*;

// Connect to the Flash component service and create service object
var CFCService:Service = new Service(
"<a target=_blank class=ftalternatingbarlinklarge
href="http://localhost/flashservices/gateway",
">http://localhost/flashservices/gateway",
</a> null,
"sandbox.testDir.flashComponent",
null,
null );
// Call the service helloWorld() method
var pc:PendingCall = CFCService.helloWorld();
// Tell the service what methods handle result and fault conditions
pc.responder = new RelayResponder( this, "helloWorld_Result",
"helloWorld_Fault" );

function helloWorld_Result(re:ResultEvent)
{
// Display successful result
messageDisplay.text = re.result.HELLOMESSAGE;
timeDisplay.text = re.result.TIMEVAR;
}

function helloWorld_Fault(fe:FaultEvent)
{
// Display fault returned from service
messageDisplay.text = fe.fault;
}

What do I need to do to get this working on a MX 7 server and would the same
code run on MX6.1 ?
Oh and I have been publishing as Flash 7 actionscript v2
Re: Having a heck of time with Remoting ips007
5/31/2006 8:58:17 PM
Update I got the hello world example to work on my mx6.1 server, but still not
working on 7.
...I had a typo in the service path :o.

This does shed some light though...the "newer method" does work on 6.1 and I
guess I should go that route... I Guess?
AddThis Social Bookmark Button