PDA

View Full Version : mx.remoting compile error


meddlingwithfir
09-10-2007, 08:26 PM
I'm taking my first stab at using the mx.remoting.Service class -- I have been using the deprecated NetServices for all my past projects.

I'm running into a pretty basic stumbling block. I've got some test code running:



import mx.remoting.*;
import mx.rpc.*;

// VARIABLES
var GATEWAY_URL:String = "http://[domainName]/flashservices/gateway/";
var COMPONENT_PATH:String = "components.flashgallery";

// Set up the connection Service
var myService:Service = new Service(
GATEWAY_URL,
null,
COMPONENT_PATH,
null,
null
);

var pc:PendingCall = myService.selectFlashGalleryData(1);
// Tell the service what methods handle result and fault conditions
pc.responder = new RelayResponder(this, "selectFlashGalleryData_Result", "selectFlashGalleryData_Fault" );

function selectFlashGalleryData_Result(re:ResultEvent):void
{
// Display successful result
trace("Got Results.");
// messageDisplay.text = re.result.HELLOMESSAGE;
// timeDisplay.text = re.result.TIMEVAR;
}

function selectFlashGalleryData_Fault(fe:FaultEvent):void
{
// Display fault returned from service
trace("Got Errors.");
// messageDisplay.text = fe.fault;
}


But when I compile, I get the following errors:
The class or interface 'Service' could not be loaded.
The class or interface 'PendingCall' could not be loaded.
The class or interface 'ResultEvent' could not be loaded.
The class or interface 'FaultEvent' could not be loaded.

So it seems that my imports early up don't seem to be working? My publish settings are for Flash Player 8, Actionscript 2.0.

Is there something I'm missing in my code, or have I set up my publish settings incorrectly?

Thanks!

meddlingwithfir
09-10-2007, 08:32 PM
Forgot to mention as well -- I'm on Flash CS3 Professional, Version 9.0.

Do I need to install the Flash Remoting MX Components? I looked on this page, and it doesn't look like there are downloads available for Flash 9:

http://www.adobe.com/products/flashremoting/downloads/components/

Did they come standard with my Flash 9 installation?

meddlingwithfir
09-10-2007, 08:41 PM
Must be something with my Flash 9 IDE -- I fired up the code in Flash 8 (luckily, I kept the old installation) and it runs just fine.