Ok I’ll post my code and explain, this is using flash remoting and amfphp
main.fla / main.swf
// ==============================
// SETUP
// ==============================
var rootId:Number = 0;
var itemArrayCall:itemsClass = new itemsClass();
trace (itemArrayCall.getItemsList(rootId));
stop();
itemsClass.as
// ==============================
// IMPORTS
// ==============================
import mx.remoting.*;
import mx.rpc.*;
import mx.utils.Delegate;
import mx.remoting.debug.NetDebug;
// ==============================
// CLASS CONSTRUCTOR
// ==============================
class itemsClass {
// Gateway
private var gatewayUrl:String = "http://xfuzion.local/%7Exfuzion/finalproject/flashservices/amfphp/gateway.php";
// Service
private var service:Service;
// == SETUP FUNCTION
function itemsClass() {
NetDebug.initialize();
this.service = new Service(this.gatewayUrl, null, "itemsClass");
}
// == getItemsList FUNCTION
function getItemsList(rootId) {
var pc:PendingCall = service.getItemsList(rootId);
pc.responder = new RelayResponder(this, "handleGetItemsList", "handleRemotingError");
return "It will return these values but will not initialize the net debugger AT all or anything";
}
// == RESULT HANDLER FUNCTION
function handleGetItemsList(re:ResultEvent) {
return "it worked";
}
// == ERROR HANDLER FUNCTION
function handleRemotingError(fault:FaultEvent):Void {
NetDebug.trace({level:"None", message:"Error: "+fault.fault.faultstring});
}
}
My problem is the fact the class works, everything works inside of it EXCEPT the remoting. It wont even initialize or run the NetDebug and it’s bugging me because I have no way to debug this because of it.
Any help on why it isn’t transfering or whatever would be very useful.
I get NO output errors at all, so all the MX components are on the stage correctly and amfphp is set up perfectly fine ( this whole thing works fine if I use it inline rather than class ).
Thanks!