Arrays for questions?

Hi,

I have a project in which I’m asking the user to tick yes or no boxes.

If the answer is yes then a needle on a separate movie goes closer to the red(right) and if the answer is no then the needle stays where it is.

This was all fine until the user ticks yes then changes their mind to no… the needle would then stay where it was rather than going backwards(towards the green) because I had set it up to not do anything if the no button was pressed initially?

I was told that setting up the buttons as arrays would be the best option but on trying to learn about arrays I’ve become completely confused?

Can anyone help?

oh additionally the amount of ticks dictate certain events that happen to the needle movie so they need to trigger events some how?

Thanks

Spence

Arrays, they are fun. I’m not sure which areas of arrays you are confused about :h:

However from your description I don’t think you need to use arrays. What I would do is just move the rotation of the needle.

// This is just pseudo code, not actionscript.
I.e. if (correct) object._rotation+=5; else object._rotation-=5;

Do you see what I mean?

Hope that helps :slight_smile:

Yes… which is what I had originally but the no answer initually results in not a minus movement but no movement. Only if the yes has already been ticked then is unticked by a no instead should the needle be minus’d?

Im not sure on the writting of arrays … I understand the principle but not the practice :frowning:

Spence

Perhaps I should explain my questionaire more clearly.

There are a number of questions with a tick box to the side of them ie:

  1. are you tall? yes no
  2. do you have blue eyes? yes no
  3. do you drive a car? yes no

etc

with every yes answer the needle on a meter goes right
with a no answer the needle stays where it is.

the problem:

if you answer yes to one of the questions then change it to no
besides question one the needle will have to go left.

That’s why the simple _x +1 or -1 doesn’t work?

I hope this makes more sense :smiley:

Spence

Then, (hope that’s what you mean)

if (yes) {

  • 1
    } else {

if(previously yes && not question 1) {
-1;
} else {
do nothing.
}

}