In the below example we will use Actionscript 2 to call a remote PHP file that will return data to it.
It is a simple way of transferring data between the server and client.

Actionscript 2 Code:

[code lang=”actionscript”]
callRemoteFile = function(ourVariable:String) {
var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean) {
if (success) {
if (result_lv.message==”success”)
trace(“done! “+result_lv.returnValue);
} else {
trace(“Error connecting to server”);
return false;
var send_lv:LoadVars = new LoadVars();
send_lv.ourVariable = ourVariable;
send_lv.sendAndLoad(“”, result_lv, “POST”);
callRemoteFile(“some text here”);

PHP Code:

[code lang=”php”]

Leave a Reply

Your email address will not be published.

%d bloggers like this: