8 Replies Latest reply on May 9, 2006 1:37 AM by kalyanchakri

    simple question

    The_350Z
      Hi

      Attached is the script I'm curretnly working on.
      I want it so that if ALL values = FALSE then proceed = FALSE. If a TRUE value is detected than proceed = true.

      Right now what I'm getting is that if the last value is false (clip_1.connections[connection1[2]]), then proceed will become FALSE too, regardless what the rest of the values are.

      Any help would be greatly appreciated
        • 1. Re: simple question
          Sarford Level 1
          I'm guessing that your movieclip name is clip_1.connections.connection11 etc?
          If thats the case then you should write:

          _root.clip_1.connections["connection1"+i]

          hope this helps
          • 2. Re: simple question
            The_350Z Level 1
            oh well no actually, connection1 is actually from an array.. it looks like this:

            connection1 = this_array[ k ][ 3 ]
            and i have more than 5 of this_array[ k ][ 3 ]

            so to sum it up --> clip_1.connections[connection1[ i ]] , will return a boolean value.

            • 3. Re: simple question
              Level 7

              "The 350Z" <webforumsuser@macromedia.com> wrote in message news:e3op30$99q$1@forums.macromedia.com...
              > Hi
              >
              > Attached is the script I'm curretnly working on.
              > I want it so that if ALL values = FALSE then proceed = FALSE. If a TRUE value
              > is detected than proceed = true.
              >
              > Right now what I'm getting is that if the last value is false
              > (clip_1.connections]), then proceed will become FALSE too, regardless what the
              > rest of the values are.
              >
              > Any help would be greatly appreciated
              >
              > for (i = 0 ; i < 3 ; i ++) {
              > if (clip_1.connections[connection1 ] == false) {
              > proceed = false;
              > } else {
              > proceed = true;
              > }
              > }

              var count = 0;
              for (i = 0 ; i < 3 ; i ++)
              {
              if (clip_1.connections[connection1[ i ]] == false)
              count++;
              }

              if(count == 3)
              proceed = false;
              else
              proceed = true;


              It's just one way of various ways you could do it.
              tralfaz




              • 4. Re: simple question
                Level 7

                > var count = 0;
                > for (i = 0 ; i < 3 ; i ++)
                > {
                > if (clip_1.connections[connection1[ i ]] == false)
                > count++;
                > }
                >
                > if(count == 3)
                > proceed = false;
                > else
                > proceed = true;
                >
                >
                > It's just one way of various ways you could do it.
                > tralfaz

                // sorry, that was silly, this is better..
                proceed = false;
                for (i = 0 ; i < 3 ; i ++)
                {
                if (clip_1.connections[connection1[ i ]] != false)
                {
                proceed = true;
                break;
                }
                }


                BTW.. I changed the bracked i to have spaces so that it wouldn't switch to italics on the forum..
                [ i ]
                tralfaz



                • 5. Re: simple question
                  The_350Z Level 1
                  Hey Tralfaz, how's it going?
                  thanks for the reply.

                  I haven;t tried it yet, Im still in school, but will do after i got home.

                  I have a question though..
                  why is it different than == ?
                  i mean yea != means not equal, I just don't quite understand. What happen if I dont use the break?

                  thanks tralfaz

                  • 6. Re: simple question
                    The_350Z Level 1
                    ahh I got it, but I didnt use the != false.
                    I use the previous solution and its working like charm!!

                    Im not sure if it's silly or not, but man it's working so great for me
                    • 7. Re: simple question
                      Level 7
                      "The 350Z" <webforumsuser@macromedia.com> wrote in message news:e3p6qu$o2k$1@forums.macromedia.com...
                      > ahh I got it, but I didnt use the != false.
                      > I use the previous solution and its working like charm!!
                      >
                      > Im not sure if it's silly or not, but man it's working so great for me

                      If it works that's all that matters!
                      tralfaz


                      • 8. Re: simple question
                        kalyanchakri Level 1
                        hi simply use this

                        proceed = true;
                        for (i = 0 ; i < 3 ; i ++) {
                        if (clip_1.connections[connection1 ] == false) {
                        proceed = false;
                        }
                        }