Mailto Question
Hi everyone!
I would like to know how to pass the percGlobal variable that I created in the for loop into the body of the email that is created in the function below. Right now all it prints in the body of the email is:
percGlobal + percent
Thanks!
var nScore:Number = 0;
var nTotal:Number = 0;
var nPercentage:Number = 0;
for(var i:Number = 0; i < aQuestions.length; i++)
{
var percGlobal;
this["userAnswer" + i + "_txt"].text = aUserAnswers;
this["correctAnswer" + i + "_txt"].text = aCorrectAnswers;
if(aUserAnswers.toUpperCase() == aCorrectAnswers.toUpperCase())
{
nScore++;
}
if(i == aQuestions.length - 1)
{
score_txt.text = nScore.toString();
}
nTotal++;
correct_txt.text = nScore.toString();
total_txt.text = nTotal.toString();
percGlobal = Math.round((nScore/nTotal)*100).toString();
percentage_txt.text = percGlobal + "&" ;
}
shareBtn.addEventListener(MouseEvent.CLICK, onShare);
function onShare(event: MouseEvent) {
var request:URLRequest = new URLRequest("mailto:robert.hannan@bcbsfl.com"+"?subject=Quiz Score"+"&body= percGlobal + percent");
navigateToURL(request, "_self");
}