# (as2) if / then conditional - simple quiz

**URL:** <https://forum.kirupa.com/t/as2-if-then-conditional-simple-quiz/320082>\
**Category:** flash\
**Created:** [March 13, 2011, 8:06pm UTC](https://forum.kirupa.com/t/as2-if-then-conditional-simple-quiz/320082 "2011-03-13T20:06:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryantland](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@ryantland](https://forum.kirupa.com/u/ryantland)\
**Post date:** [March 13, 2011, 8:06pm UTC](https://forum.kirupa.com/t/as2-if-then-conditional-simple-quiz/320082/1 "2011-03-13T20:06:53Z")

</div>

trying to make a 3 question quiz on a 300x250 banner in flash. I am so close. So close. If 2 of 3 questions are answered ‘yes’, it’s should relay one function (playEndScreenYes()). If 2 of 3 questions are answered ‘no’, it should relay another function. (playEndScreenNo()). This is clearly a situation calling for the if / then statement. I have it set up, but I can’t seem to get it working. I would gladly pay you for an hour of your time today, if you are familiar with if / then conditionals, I think you could look at my code and solve the problem in 10 minutes max. I am a seasoned flash designer and I animate with as2, but I can’t wrap my head around this and its making me a little nuts.

I would be happy to send you my source files.

i’ve posted my progress here:  
[http://flashryan.com/quiz/](http://flashryan.com/quiz/)

You can see that it isn’t working right.

some code:  
//////////////////////////////////////////

bulletUp1.onRelease = function() {  
a = 1;  
if (a == 1) {  
trace(“yes1”);  
}  
yesTemp1();  
};

bulletUp2.onRelease = function() {  
b = 1;  
if (b == 1) {  
trace(“no1”);  
noTemp1();  
}

//this goes on until the final 2 buttons and i drop the if / then

bulletUp5.onRelease = function() {  
if (a \<= b) {  
trace(“yes3”);  
yesTemp6();  
}else{  
trace(“nononononon”);  
noTemp6();}  
};

bulletUp6.onRelease = function() {  
if (b \<= a) {  
trace(“no3”);  
noTemp6();  
}else{  
trace(“yesyeyesyesyes”);  
yesTemp6();  
}

Please help. I’m supposed to have this figured out by tomorrow and I’m running out of hair to pull out of my head. I have this built in cs3, but I can save up to cs4 if you like.

Thanks,  
Ryan
