submit button and checkboxes not working

submit button and checkboxes not working

Page 1 of 1

2 Replies - 1560 Views - Last Post: 12 October 2009 - 01:14 AM

#1 jrb47  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 33
  • Joined: 21-April 07

submit button and checkboxes not working

Post icon  Posted 07 October 2009 - 08:21 AM

I am working on a game it is almost complete. THIS IS NOT A HOMEWORK PROJECT, it is a project for my daughter who is a biomed student. The problem that i am having is in the codes for the submit button and the checkboxes
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


Is This A Good Question/Topic? 0
  • +

Replies To: submit button and checkboxes not working

#2 iRaptureJoshua  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 20
  • Joined: 09-October 09

Re: submit button and checkboxes not working

Posted 11 October 2009 - 03:56 AM

Are you sure the button is not working?

I don't see anything in your code that stands out. Try adding a trace function so you can see if the problem is really your button, or if maybe the problem is your function.

trace("this button works");


Was This Post Helpful? 0
  • +
  • -

#3 thehat  Icon User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: submit button and checkboxes not working

Posted 12 October 2009 - 01:14 AM

The problem here is the single equals signs in all the if statements. Single equals sets a variable, double equals is for comparison.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1