Skip to main content
November 19, 2010
Answered

Output Displays "Undefined".... Help

  • November 19, 2010
  • 1 reply
  • 562 views

Hello All,

I have posted here quite a bit for help before and I have received vast amounts of help.  Thanks in advance to anyone who can help with this.  I have some code that is returning "Undefined" in the output when I click the submit button.  I have a variable named "score" and the button is named "submit_btn". If you have any questions or need more info, feel free to ask.

var scores_lv = new LoadVars();

function showHighScores(success) {
if (success) {
  gotoAndStop(13);
}
};

submit_btn.onRelease = function() {
if (name_txt.text != '')
{
  submit_btn.enabled = false;
 
  trace(score);

  scores_lv.name  = name_txt.text;
  scores_lv.score = score;
 
  scores_lv.onLoad = showHighScores;
 
  scores_lv.sendAndLoad('scores.php',scores_lv);
}
};

This topic has been closed for replies.
Correct answer Ned Murphy

Where is the code you show located, and where is the score variable defined and assigned a value?

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
November 19, 2010

Where is the code you show located, and where is the score variable defined and assigned a value?

November 19, 2010

The score variable is defined in a seperate layer named "variables" that exists within the same frame number as that code that I pasted.

The code i pasted is located in actions portion of a seperate layer on the same frame where the variables are defined.  Hope that helps!

Ned Murphy
Legend
November 20, 2010

And where is the score variable assigned a value?