This content has been marked as final. Show 5 replies
Yes, you can use the original Flash Remoting gateway built into CF:
In your RemoteObject set the endpoint to the location of the Flash gateway in ColdFusions:
Then set the source parameter of RemoteObject to the path of the CFC without the .cfc extension.
Thank you but I am currently facing another error with that suggestion. When I call the CFC, I now receive the following Error:
TypeError: Error #1034: Type Coercion failed: cannot convert Object@48022a1 to mx.messaging.messages.ErrorMessage.
The supporting code which makes the call is below:
var lro:RemoteObject = new RemoteObject("ColdFusion");
lro.endpoint = ' http://www.desktopae.com/flashservices/gateway';
lro.source = "cfc.Security";
Thanks for any assistance you can offer.
It turns out there is more to the story. Without 7.0.2, CF must receive objects encoded for ActionScript 2.0. By default, Flex 2 sends the objects using ActionScript 3.0. This is known as ObjectEncoding.AMF0 and ObjectEncoding.AMF3, respectively.
To use Flex 2 with AMF0, you need to revert back to the way Flash does it by using a NetConnection and not a RemoteObject. When you use the NetConnection you can specify the ObjectEncoding to be AMF0. It isn't too complex, but read up on NetConnection and ObjectEncoding classes.
Alternatively, you should be able to call your CFC using WebServices and naming the CFC as the wsdl. There should be samples of that in the documentation.
I am now researching the NetConnection objects. I appreciate all your help.
I thought of using WebServices originally because the conversion to RemoteObjects wouldn't be that heavy when my host finally upgrades and all is well
The problem is though, that although I can connect to a WebService, any methods I attempt to call are returned with the error message: There is no method [myMethod] on service.
Not sure why that keeps happening, but if you do, that would be great.
If not, thank you so much! I will certainly look into both of those deeper.
What is your WebService code?
useProxy = false;