I’m sorry if this question seems more about ColdFusion than Flash, but it is in the Flash application that I am encountering the problem.
I am having a heck of a time trying to get Flash and Cold Fusion to cooperate. Either I am crazy, or it seems like all the documentation is just plain incorrect. I have created a ColdFusion component which returns information about home lots from the database in an array of structs. The component works fine when accessed by another CFM page, but Flash just refuses to believe that the variable I am returning is an array. Regardless of what I do, it seems to treat everything I send back as an Object, despite the fact that I explicitly tell it that the result will be an array.
I have found that if I send back a simple array, of say, integers, I can access them as an array even though Flash will claim I am sending an Object. However, this only works for accessing data directly (i.e. lotArray)… I don’t think any of the methods are working. When I send back an array of structures, Flash will not display any information for the structures inside.
Has anyone else come across this problem? I’m really pulling out my hair here. All the documentation I’ve read tells me to do exactly what I am doing, and yet Flash does not cooperate. If anyone has any idea how to get this going, please let me know. As a last resort, I know I could rework my data so it comes back in some kind of form that Flash can understand, but it will be awkward, and make the component useless for use with CFM-only apps, which is kind of the point of using a component in the first place.
Here is my connection code:
// connect to service and create service object
var DTHService:Service = new Service(
// call the service getLotArray() method
var pc:PendingCall = DTHService.getLotArray();
// tell the service what methods handle result and fault conditions
pc.responder = new RelayResponder( this, “getLotArray_Result”, “getLotArray_Fault” );
// display successful result
var lotArray:Array = new Array();
lotArray = result.result;
trace("lot: " + lotArray.id);
trace("price: " + lotArray.price);
trace("length: " + lotArray.length);
price_txt.text = lotArray.price;
id_txt.text = lotArray.id;
//display fault returned from service
price_txt.text = “unsuccessful”;
error_txt.text = fault.fault.faultstring;
Here is the function tag from CFM:
<CFFUNCTION name=“getLotArray” access=“remote” returntype=“array”>
There are no parameters required. The actual function itself is pretty long and complicated, and doesn’t seem necessary to post since i know it works when I test it through CFM. If anyone thinks it necessary, however, I can post the CFM code as well.
Thank you all in advance!