PDA

View Full Version : Remoting & DataTypes (I think...)


the ev
09-14-2007, 11:44 PM
(I know this is a question better directed towards the Remoting sub-forum, but this is such a simple thing (I think) and this forum seems to get more traffic...)

Long story short, I'm using Fluoride to do my remoting and it works. Well, the NetDebugger gives me the correct response from my DLL. But if I try to use the ResultEvent of my PendingCall, it is always undefined (string, int, double, whatever). Why does NetDebugger give me what I want (so, if it was a string, I'd get the right string in the NetDebugger window...like "Hello World!" from my DLL, or whatever) while if I try to use that result in AS2 I get "undefined" (if I simply trace(re.result); where re:ResultEvent)????

rabidGadfly
09-15-2007, 02:13 AM
What datatype are you returning from your function (query, string boolean, etc.)?

the ev
09-15-2007, 03:38 AM
You mean from the DLL?

At first an int. Then I tried double, then string. None seemed to work.

the ev
09-15-2007, 07:27 AM
Got it!!!

I was calling my result as a type ResultEvent, which I don't know if it exists/works (found it on an example on another website), but if I change it to simply "result", it works!

So,


pc.onResult = function (result)
{
trace(result);
}


...works. Using re:ResultEvent and re.result does not (at least for me it didn't). I might have been doing something wrong the other way, but I'm just happy I've found a way that works.

(For more of my remoting code, see this (http://www.actionscript.org/forums/showthread.php3?t=145757) other post).

I thank everyone who's ever written a remoting tutorial because there seem to be so many approaches, so after pirating bits of code from each I've managed to scrounge up something that works. Kudos! :p

PS: Here's (http://www.sitepoint.com/article/coldfusion-mx-flash-remoting) the other tutorial where I got the inspiration from. I think the web could stand a few more tutorials written about Remoting & .NET; there are a million out there concerning PHP & CF... oh well. If I ever get good enough at this sort of thing, I'll be sure to write one...or a few. ;)