I am going to list the code and hope that it makes sense.
the pseudo code is:
1. player chooses two choices for each element listed
2. when the submit button is hit the checkboxes are given a number value
3. those values are added together and compared to the value pulled from the database
4. if correct they go to next substance - it should just reload frame 8 (i think)
5. if incorrect it goes to frame 11
the submit button is not working so i can not tell if the checkboxes are working
full files can be found at
http://teachingbytec....com/finalgame/
substance.text = myVars.substance;
sum.text= myVars.sum;
score.text = Score;
var atoms:Number = 0;
var ions:Number = 0;
var compound:Number = 0;
var molecule:Number = 0;
var element:Number = O;
submit_btn2.onRelease = function()
{
CreateAnswers();
}
function CreateAnswers() {
if (cb.ionic_compound = selected)
ions = 6;
if (cb.compounds = selected)
compound = 2;
if (cb.molecule = selected)
molecule = 3;
if (cb.element1 = selected)
element = 4;
if (cb.atom = selected)
atoms = 5;
var sum2 = ions + compound + molecule + element + atoms;
if (sums2 = myVars.sum)
{
Score = Score + points;
gotoandstop(8);
}
else if (sums2 != myVars.sum)
{
gotandstop(11);
}
}
This post has been edited by jrb47: 07 October 2009 - 08:25 AM

New Topic/Question
Reply



MultiQuote





|