View Full Version : flash remoting

10-23-2003, 10:07 AM
I am trying to use flash remoting with the amfphp component. I copied a fairly easy example from this site. (talkback example) -- the problem I seem to be having is this: in the example mulitple calls are made to various methods of the object talkback. These calls occur consecutively. When I attempt to run the flash movie I get an error saying that the class was not found or known to the gateway. However, if I only run one call the movie executes perfectly. Also, if I create a new connection before each call the movie works, returning answers in the reverse order. -- So I guess my question is, --->> what could I have incorrectly set up.



Moved to the Server Integration - Flash MX Remoting
Please state what your working environment is and
please post in the right forum

10-23-2003, 04:37 PM
local environment - Apache server, PHP, OS: windows XP pro.

10-23-2003, 04:46 PM
Quite possibly a scope problem, where is the actionscript you tried?

10-23-2003, 08:18 PM
#include "NetServices.as"
#include "NetDebug.as"

// where jmdoczy is set as my localhost
path = "http://jmdoczy/flashservices/gateway.php"

serverConn = NetServices.createGatewayConnection();
class = serverConn.getService("talkback", this);

function returnString_Result(result) {
traceT("Got result \""+result+"\" of type "+typeof (result));
function returnNumber_Result(result) {
traceT("Got result \""+result+"\" of type "+typeof (result));
function returnArray_Result(result) {
traceT("Got result \""+result+"\" of type "+typeof (result)+
" which contained the following:\n");
for (item in result) {
traceT(item+": "+result[item]);

traceT("Calling returnString");
class.returnString("Flash Remoting is groovy");

traceT("Calling returnNumber");

traceT("Calling returnArray");
test = new Object();
test.foo = "bar";


function traceT (str){
textField.text += str+newline;