Flash AS3 - Passing between variables
I'm trying to retrieve a score from a database, hold it in a variable and then use it within other action script functions.
I have managed to retrieve the score froom the database just fine, however I am having a problem passing the result from the user_score variable to the score variable so that I can reuse the value throughout the rest of the action script.
Can anyone shed some light on what I'm doing wrong? :confused:
Please see the snippet below:
//Get The Score from the database
var variables:URLVariables = new URLVariables();
var request:URLRequest = new URLRequest();
request.method = URLRequestMethod.POST;
var loader:URLLoader = new URLLoader();
request.url = "http://www.operationclimatechange.com.au/layer/ws/xFlashScore.php";
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
//Function to Get Score of the logged in user and store it in a variable called "score"
// Score Scale //
//score user earns in missions
var total_balloons=1400;//total balloons available 1200
var balloons=0;// balloons earnt or lost in the game for each object
var user_balloons=score+balloons;//total ballons won or lost during game