I’ve never attempted this before and would appreciate some advice on connecting to server-side scripts at a different domain.
For example, on one domain would be the main site with all the .swf’s, but the database containing the relative information is on a different domain and the two need to communicate with each other.
Would I use the LocalConnection object or if possible, could someone post an example to connect to a .php file on a different server than the .swf that is calling it.
The main issue why I’m asking is the main site server is nt with asp and I need to call a php file to connect to a database whereby both are on a *nix server.
var my_lv = new LoadVars();
my_lv.onData = function(src) {
if(src==undefined){
output_txt.text = "Unable to connect to server!";
}else{
output_text.text = src;
}
}
my_lv.load("http://www.mydomain.com/returnData.php?foo=iamdata");
When I test this I get my custom error msg because there was no data loaded.
I’ve even put a crossdomain.xml file where the .swf is stored to accept the domain where the test php script is stored.