-
Simple question. I have a button that set the variable for answer1 to 1 or 0 for a correct answer or incorrect answer. On the button proceed the following:
on (release) {
if (answer1=1) {
field15 = field15 + 2;
} else {
field15 = field15 ;
}
gotoAndStop (35);
}
BUT, it adds 2 to the field15 variable no matter what...
Any help would be great !
Thanks,
-
Pillow Daddy
This is a simple but very irritating problem if you do not spot what is wrong. The if statement should look like this:
on (release) {
if (answer1==1) {
field15 = field15 + 2;
}
gotoAndStop (35);
}
Note the double equals used for the if condition, if you miss this out then strange things start to happen! Also the else part of your code is not needed- why tell the computer to make a variable what it already is?!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|