La trasposizione spicciola in AS3 di quel codice sarebbe questa:
Codice PHP:
var titolo:Text="{data.titolo}"; // non mi torna, cos'è?
var data_send:URLVariables = new URLVariables();
data_send.titolo = titolo;
var request_send:URLRequest = new URLRequest();
request_send.data = data_send;
request_send.method = "post";
request_send.url = "http://xxxxx/xxx.asp";
var sender:URLLoader = new URLLoader(request_send);
sender.addEventListener(Event.COMPLETE, onLoadHandler);
function onLoadHandler (evt:Event):void {
try {
trace(funziona);
trace(dati_send);
testo_txt.text = "FUNZIONA!";
out = dati_send.out;
} catch (err:Error) {
testo_txt.text = "IELLA!";
}
}