# Arrays for questions?

**URL:** <https://forum.kirupa.com/t/arrays-for-questions/118166>\
**Category:** Uncategorized\
**Created:** [August 3, 2004, 9:51am UTC](https://forum.kirupa.com/t/arrays-for-questions/118166 "2004-08-03T09:51:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spence](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@spence](https://forum.kirupa.com/u/spence)\
**Post date:** [August 3, 2004, 9:51am UTC](https://forum.kirupa.com/t/arrays-for-questions/118166/1 "2004-08-03T09:51:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael\_Chen](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@Michael\_Chen](https://forum.kirupa.com/u/Michael_Chen)\
**Post date:** [August 3, 2004, 10:12am UTC](https://forum.kirupa.com/t/arrays-for-questions/118166/2 "2004-08-03T10:12:46Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![spence](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@spence](https://forum.kirupa.com/u/spence)\
**Post date:** [August 3, 2004, 11:08am UTC](https://forum.kirupa.com/t/arrays-for-questions/118166/3 "2004-08-03T11:08:50Z")

</div>

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 ☹

Spence

---

<div class="post-metadata">

**Author:** ![spence](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@spence](https://forum.kirupa.com/u/spence)\
**Post date:** [August 3, 2004, 1:02pm UTC](https://forum.kirupa.com/t/arrays-for-questions/118166/4 "2004-08-03T13:02:51Z")

</div>

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 😃

Spence

---

<div class="post-metadata">

**Author:** ![Michael\_Chen](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@Michael\_Chen](https://forum.kirupa.com/u/Michael_Chen)\
**Post date:** [August 4, 2004, 11:21am UTC](https://forum.kirupa.com/t/arrays-for-questions/118166/5 "2004-08-04T11:21:09Z")

</div>

Then, (hope that’s what you mean)

if (yes) {

- 1  
} else {

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

}
