Skip navigation
Currently Being Moderated

rubyAMF Flash give parameters

Oct 11, 2010 9:37 AM

Hello ,

Its been 1 day that i am trying to give some parameters to a ruby function from the flash side

 

import flash.net.*;

var nc:NetConnection = new NetConnection();

nc.connect("http://localhost:3000/rubyamf_gateway");

var responder:Responder=new Responder(onResult,onFault);

 

var parameters:Array = new Array();
parameters[0] = 'bob';
parameters[1] = '52';

 

nc.call("UsersController.add_user", responder,{username:'test',score:99});

 

 

The ruby function is like that

 

def add_user(username,score)
     new_user_hash = {"username" => username,"score" =>score}
     User.new(new_user_hash)
    
end

 

 

I tried a lot of thing

 

nc.call("UsersController.add_user", responder,parameters);

nc.call("UsersController.add_user", responder,[{username:'test',score:99}]);

 

 

nothing works

 

Please if you have any ideas

Thanks

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points