Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

How do I get the sum of my variables and display the total?

$
0
0

I have written out a quiz and have each button setting a variable, example: http://www.kreativitydesigns.com/Clients/Globus/Monograms/MBA_Test/del iverables/MBA_Quiz.html?mode=preview

 

However, when it hits the "Grade" frame to calculate and display the total, it is not displaying. 

I do have the text box named "Grade" on stage and the variables have all been given a value before entering this frame

 

Here is the code used to calcualte and output the result:

 

//get the value of a variables and store them

var FinalScoreHolder = q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 + q10 + q11 + q12 + q13 + q14 + q15 + q16 + q17 + q18 + q19 + q20 + q21 + q22 + q23 + q24 + q25 + q26 + q27 + q28 + q29 + q30 + q31 + q32 + q33 + q34 + q35 + q36 + q37 + q38 + q39 + q40;

 

//Display the Grade

sym.$("Grade").html("You scored "+FinalScoreHolder+"%");

 

 

//Show Result Page

if (FinalScoreHolder >= 89) {

 

// play the timeline from the given position (ms or label)

sym.play("pass");

 

} else {

 

// play the timeline from the given position (ms or label)

sym.play("fail");

}

 

Any help would be greatly appreciated.

 

Thanks!


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>