Forum Moderators: open
function onDataLoad(evt:Event){
Title_txt.text = evt.target.data.Title;
}
//error callbacks
function onIOError(evt:IOErrorEvent){
trace("IOError: "+evt.text)
}
function onHTTPStatus(evt:HTTPStatusEvent){
trace("HTTPStatus: "+evt.status)
}
function onSecurityError(evt:SecurityErrorEvent){
trace("SecurityError: "+evt.text)
}
The above code grabs a piece of data from a file called test.php:
<?php
echo "Title=hello";
?>
It works perfectly, but I want to be able to set the value (evt.target.data.Title;) to a variable and use the variable outside of the onDataLoad function. How do I create a global ActionScript variable that holds the data from the external file so I can then use that variable outside of the function?