rabidGadfly
05-19-2008, 08:46 PM
I'm trying to pass a structure to a ColdFusion component from Flash but it keeps failing with this error:
"Unknown object type tag (17)"
Here's my AS. I've tried using Array, Object, and Dictionary as types:
loadData_btn.addEventListener(MouseEvent.MOUSE_DOW N, loadData)
var myService = new NetConnection()
myService.connect("http://localhost/flashservices/gateway/")
function loadData(evt:MouseEvent){
var responder = new Responder(getTest_Result, onFault);
var mystruct:Array = new Array();
mystruct["mystring"] = "hello";
myService.call("com.mycomponent.test", responder, mystruct);
}
function getTest_Result(result){
trace("success: "+ result);
}
function onFault( f){
trace("There was a problem: " + f.description);
}
...and here's my component function (I've tried with an argument type of 'struct' as well as 'any':
<cffunction name="test" output="no" access="remote" returntype="string" >
<cfargument name="argstruct" type="any" required="yes" />
<cfset mystr =arguments.argstruct["mystring"]>
<cfreturn mystr />
</cffunction>
I was successful in sending and returning a string as a test to ensure that the apps were set up correctly. It's only when I try to pass a struct that I get an error.
Thanks in advance for any help,
Glenn
"Unknown object type tag (17)"
Here's my AS. I've tried using Array, Object, and Dictionary as types:
loadData_btn.addEventListener(MouseEvent.MOUSE_DOW N, loadData)
var myService = new NetConnection()
myService.connect("http://localhost/flashservices/gateway/")
function loadData(evt:MouseEvent){
var responder = new Responder(getTest_Result, onFault);
var mystruct:Array = new Array();
mystruct["mystring"] = "hello";
myService.call("com.mycomponent.test", responder, mystruct);
}
function getTest_Result(result){
trace("success: "+ result);
}
function onFault( f){
trace("There was a problem: " + f.description);
}
...and here's my component function (I've tried with an argument type of 'struct' as well as 'any':
<cffunction name="test" output="no" access="remote" returntype="string" >
<cfargument name="argstruct" type="any" required="yes" />
<cfset mystr =arguments.argstruct["mystring"]>
<cfreturn mystr />
</cffunction>
I was successful in sending and returning a string as a test to ensure that the apps were set up correctly. It's only when I try to pass a struct that I get an error.
Thanks in advance for any help,
Glenn