PDA

View Full Version : [mx] checkboxes, arrays & loops!



chartrandi
October 11th, 2003, 03:25 PM
Hi,

here's what I'm talking about (http://www.geocities.com/chartrandi/check.html)

Here is the FLA file (http://www.geocities.com/chartrandi/check.fla)

I have three checkboxes (not mx components) and a dynamic textbox on which the "showtext" variable is assigned. I want the dynamic text box to display the labels attached to checkboxes when they return a value of 1 : (box one is checked, box2 isn't so the label doesn't appear, and so forth.)

I figured I need to use an array for the checkbox labels.

I probably need a loop that verifies which checkboxes are checked (value=1). and use an array to combine the checked boxes with their respective label.

Any help would be greatly appreciated, for I've been stuck with this problem for 3 days now and I'm confused.

-Isabelle :smirk:

Voetsjoeba
October 11th, 2003, 03:42 PM
If more than one is selected, say three for example, do you want all three the labels to appear in the textbox ?

chartrandi
October 11th, 2003, 04:49 PM
>If more than one is selected, say three for example, do you >want all three the labels to appear in the textbox ?

Yes. All checked boxes titles should appear in the textbox.
if #1 and #3 are selected, labels 1 and 3 in texbox,
if #2 and # 3 selected, labels 2&3
if none, no label
if all are selected, all labels appear in textbox.

Oh, I forgot to mention. I will have approximately 20 choices, so that's why I thought I should use an array to make it easier to update later.

thanks.