hey all. I’m an AS3 newbie and want to replace some old loadVars() code with what works. Here’s what I have:
private function getPath(){
var loader:URLLoader = new URLLoader();
// specify format as being variables
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, varsLoaded);
loader.load(new URLRequest("includes/config.php"));
function varsLoaded (event:Event):void {
loader.removeEventListener(Event.COMPLETE,varsLoaded);
trace(loader.data is URLVariables); // true
trace(loader.data["Path"])
}
}
And here’s what is kicked out in my output window:
".$Path.".".$pLocale);
}
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
?>
So it is reading the file, but not reading the name/value pair. Here’s what is in the config file:
<?
$Path = "mysite.com";
[but waaaay down at the bottom]
if(isset($_GET['variable'])){
echo("pathtoxml=".$pathtoxml."&Path=".$Path.".".$pLocale);
}
?>
so it is actually reading the php file and taking it from this code and reading the variable to the actual end of the php file itself, including the closing brackets. If I delete this code, it returns “undefined”. Any help would be GREATLY appreciated!!!