Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / May 2006



Tip: Looking for answers? Try searching our database.

Having a heck of time with Remoting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ips007 - 31 May 2006 21:05 GMT
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
ips007 - 31 May 2006 21:58 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.