DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Flash 8 AS2 REMOTING With AMFPHP

01.25.2007
| 8592 views |
  • submit to reddit
        This code should be used to perform remoting with Flash 8 using ActionScript 2.

// remoting
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.remoting.debug.NetDebug;

NetDebug.initialize();

var myResponder:RelayResponder = new RelayResponder(this,"say_Result","say_Fault");
var siteCFC:Service = new Service("http://127.0.0.1/flashservices/gateway.php",null,"HelloWorld",null,myResponder);
var temp_pc:PendingCall = siteCFC.say("Hola chicos!");

function say_Result(re){
	trace(re.result);
}
function say_Fault(result){
	trace("error!");
}