Hi,
The written code does not give sufficient time for sending the data across the network and receiving the result.
Code:
envelope.sendAndLoad("http://www.mywebsite.com/try.php",envelope_rcv,"GET");
_root.text1 = envelope_rcv.path;
You can rewrite this piece of code using the "onLoad" event handler. This handler is invoked after the implementation of sendAndLoad. Moreover, it is not necessary to have 2 LoadVars instances.
Code:
url = "http://www.mywebsite.com/try.php";
var envelope:LoadVars = new LoadVars();
envelope.val1 = '41.5';
envelope.val2 = '12.3';
envelope.sendAndLoad(url,envelope,"POST");
envelope.onLoad = function(success){
//assuming path is the result returned from php
_root.text1 = this.path;
}