dex002
08-23-2005, 12:48 AM
I cannot figure out why this isn't working. The web service works if I use test variable instead of flash.params, but as soon as I use flash.params the service throws errors. Its driving me crazy. Here is the AS followed by the CFC code.
stop();
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
import mx.remoting.debug.NetDebug;
NetDebug.initialize()
var credsService:Service = new Service(
"http://127.0.0.1:8500/flashservices/gateway",
null,
"coldfusion.components.GetCredsForFlash",
null,
null);
pc = credsService.getCreds();
pc.responder = new RelayResponder(this, "getCreds_Result", "getCreds_Fault");
var credsArray:Array = new Array()
credsArray[0] = "test1"
credsArray[1] = "test2"
credsArray[2] = "test3"
credsService.getCreds(credsArray)
function getCreds_Result( re:ResultEvent ):Void {
trace("good")
trace("result is " + re.result)
}
function getCreds_Fault( fe:FaultEvent ):Void {
trace("bad")
}
<cfcomponent>
<cffunction name="getCreds" access="remote" returntype="string">
<cfif Flash.Params[1][1] is "Test1">
<cfset result="true">
<cfelse>
<cfset result="false">
<cfreturn result>
</cfif>
</cffunction>
</cfcomponent>
stop();
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
import mx.remoting.debug.NetDebug;
NetDebug.initialize()
var credsService:Service = new Service(
"http://127.0.0.1:8500/flashservices/gateway",
null,
"coldfusion.components.GetCredsForFlash",
null,
null);
pc = credsService.getCreds();
pc.responder = new RelayResponder(this, "getCreds_Result", "getCreds_Fault");
var credsArray:Array = new Array()
credsArray[0] = "test1"
credsArray[1] = "test2"
credsArray[2] = "test3"
credsService.getCreds(credsArray)
function getCreds_Result( re:ResultEvent ):Void {
trace("good")
trace("result is " + re.result)
}
function getCreds_Fault( fe:FaultEvent ):Void {
trace("bad")
}
<cfcomponent>
<cffunction name="getCreds" access="remote" returntype="string">
<cfif Flash.Params[1][1] is "Test1">
<cfset result="true">
<cfelse>
<cfset result="false">
<cfreturn result>
</cfif>
</cffunction>
</cfcomponent>