Skip to main content
Known Participant
November 12, 2007
Answered

How to make several Check boxes interact to load a movie

  • November 12, 2007
  • 27 replies
  • 1580 views
Hello,
I have a very complicated doubt. I have a document called “selection” with 15 check boxes.

The check boxes are divided into groups. The first group is “category” and has 4 check boxes named “eco”, “conf”, “spor” and “ultr”, the second group is “makers” and has 4 check boxes named “bridge”, “dun”, “cont” and “fire”, the third group is “velocity code” and has 4 check boxes named “j”, “k”, “l” and “m”, finally the fourth group is “Run Flat” and has 3 check boxes named “yes”, “no” and “just” and I have a submit button.
I have also a “main” document that has 20 holders called “holder1”, “holder2”, and so on…

I would like to know if there is a way of, when I click the submit button if, for example, the check boxes “eco” and “conf” of the first group, the check boxes “bridge” and “fire” of the second group, the check boxes “j” and “m” of the third group and the check box “just” of the fourth group are selected, then, the movie “eco_bridge_j_just.swf” is loaded to holder1, the movie “eco_bridge_m_just.swf” is loaded to holder2, the movie “eco_fire_j_just.swf” is loaded to holder3, the movie “conf_fire_m_just.swf” is loaded to holder4 and so on…

Please tell me that it is possible and the best way of doing it. My Action Script is not very good so I thank everyone who can help me.
This topic has been closed for replies.
Correct answer kglad
you have to understand those 4 for-loops if you want your swfs to load into particular alvo movieclips. if you don't care where your swfs load you can probably use:

27 replies

kebatAuthor
Known Participant
November 13, 2007
I've tried to use your code but nothing happened. I added the third and fourth group but when I test my movie the output panel keeps saying: "submitBtn.onPress=function(){ Statement block must be terminated by '}'" .
I've already told you that my action script is very bad. I've tried to insert the } everywhere I thought it belonged and now I have a "no errors" script but it still doesn't work.
I was thinking that since my fourth group has only 3 check boxes and I wanted users to pick only one, to substitute the check boxes for radio buttons but I don't know if I'm complicating too much. The search for the results must include the fourth group.
I know this is very complicated but is there any simple way of doing what I want?

kebatAuthor
Known Participant
November 13, 2007
Yes! That's what I meant. But in the fourth group I want the user to choose just one of the 3 check boxes.
The swf's are very small and I want the "main" document to be loaded in level 0 and the swf's to be loaded in the targets that I've created in the "main" document.

I know it looks crazy but I have no idea of another way of doing it. Please help me!
kglad
Community Expert
Community Expert
November 13, 2007
then create 4 arrays with each array containing the checkbox instance names of the 4 groups:

kglad
Community Expert
Community Expert
November 13, 2007
you mean to say if someone checks 2 boxes in the first group, 3 boxes in the 2nd group, 2 boxes in the 3rd group and 2 boxes in the 4th group, you want to download 24 swfs?
kebatAuthor
Known Participant
November 13, 2007
The instance name of my check boxes are the ones I wrote in the first message.

If I could write a code that find witch check boxes are selected and arrange a way to start for the first group (if there is no check box selected it will assume that all of them are selected) and in the loadMovie write the name of the fist check box selected, go to the second group to see the name of the first check box of the 2nd group and write it in the loadMovie, go to the first selected check box of the third group and write it in the loadMovie, the same with the forth group and then return to the first group to see the second check box selected and so on until the LoadMovie has a series of other combinations.

I believe that is the only way of doing this. I have to use check boxes because in the first, second and third group users can have more than one choice. Only in the fourth group I could use radio buttons.

I am prepared to do the amount of documents necessary for this to work. I can't think of an easy way of doing what I want. I'm going crazy all over again.

Thank you for helping me.
kglad
Community Expert
Community Expert
November 13, 2007
with checkboxes you'll need to loop through them all to find which are selected (using the selected property of checkboxes). to do that you should list you checkbox instance names in an array.

because you're using checkboxes it will be probably be possible for users to chose combinations that do not correspond to a valid file name. you'll need to do something about that.
kebatAuthor
Known Participant
November 13, 2007
Hello! Here I am, annoying you again.
Do you remember the help you gave me with a combo box?

I am using check boxes and not radio buttons. I believe that is the only way of having more than one check box selected.
When I said that I have four groups of check boxes I didn't realized that There is a way of grouping them. (Did I say that my English sucks?) What I mean is that I have four groups in the design and not in any other way because I don't know how. I'm not sure if I'm explaining myself properly.
My other problem is that My action Script is very, very, very bad.

Please help me again!
kglad
Community Expert
Community Expert
November 12, 2007
well, you can't check more than one radio button in a group. but once you straighten that out, yes you can do what you want.

you can

1 use each radiogroups' selection property to read the instance name of the selected radiobutton in each group.

2. concatenate those names to form the name of your swf.

3. do whatever you like with that name including loading into a target movieclip.