14 Replies Latest reply on Jul 30, 2007 12:06 PM by kglad

    What is wrong!!!!

    jak9942 Level 1
      i am using this code to make a check box become selected if a text box contains the word "yes" for some reason it is not working.
        • 1. Re: What is wrong!!!!
          kglad Adobe Community Professional & MVP
          is that code executing after your textfield's text property changes to "yes"?

          p.s. that won't work if the textfield contains the word "yes". it works if the textfield's text property is "yes".
          • 2. Re: What is wrong!!!!
            Level 7
            Hi Jak...

            Just before this block of code, try this:

            trace (att_flashintro_txt);
            trace ('Type is: '+typeof(att_flashintro_txt));
            trace ('Text value is: '+att_flashintro_txt.text);

            ...What do you see? Suspect you're probably targetting a non-existent
            object here.

            Patrick

            jak9942 wrote:
            > i am using this code to make a check box become selected if a text box contains
            > the word "yes" for some reason it is not working.
            >
            > if (att_flashintro_txt.text="yes") {
            >
            > att_flashintro_cb.selected = true;
            > } else {
            > att_flashintro_cb.selected = false;
            > }
            >

            --
            http://www.baynewmedia.com
            Faster, easier, better...ActionScript development taken to new heights.
            Download the BNMAPI today. You'll wonder how you ever did without it!
            Available for ActionScript 2.0/3.0.
            • 3. Re: What is wrong!!!!
              jak9942 Level 1
              the text field contains the word yes and the text field is changed to yes before it is executed
              • 4. Re: What is wrong!!!!
                jak9942 Level 1
                patrick,

                i got this:

                _level0.att_flashintro_txt
                Type is: object
                Text value is:
                • 5. Re: What is wrong!!!!
                  Level 7
                  There's the problem. Your text value is blank ("Text value is: "). Are
                  you sure you're accessing the right field?

                  Try this:

                  att_flashintro_txt.text="This is the real text field";

                  This should update the text. If it doesn't, you're getting your text
                  info from the wrong field.

                  Patrick



                  jak9942 wrote:
                  > patrick,
                  >
                  > i got this:
                  >
                  > _level0.att_flashintro_txt
                  > Type is: object
                  > Text value is:
                  >

                  --
                  http://www.baynewmedia.com
                  Faster, easier, better...ActionScript development taken to new heights.
                  Download the BNMAPI today. You'll wonder how you ever did without it!
                  Available for ActionScript 2.0/3.0.
                  • 6. Re: What is wrong!!!!
                    Level 7
                    Oh...and is the text field dynamic? If it's static, the text value won't
                    be accessible. Nothing will (because it's not ActionScript accessible).

                    Patrick B wrote:
                    > There's the problem. Your text value is blank ("Text value is: "). Are
                    > you sure you're accessing the right field?
                    >
                    > Try this:
                    >
                    > att_flashintro_txt.text="This is the real text field";
                    >
                    > This should update the text. If it doesn't, you're getting your text
                    > info from the wrong field.
                    >
                    > Patrick
                    >
                    >
                    >
                    > jak9942 wrote:
                    >> patrick,
                    >>
                    >> i got this:
                    >>
                    >> _level0.att_flashintro_txt
                    >> Type is: object
                    >> Text value is:
                    >

                    --
                    http://www.baynewmedia.com
                    Faster, easier, better...ActionScript development taken to new heights.
                    Download the BNMAPI today. You'll wonder how you ever did without it!
                    Available for ActionScript 2.0/3.0.
                    • 7. Re: What is wrong!!!!
                      jak9942 Level 1
                      kglad,

                      what do you mean by "the textfields text property"
                      • 8. Re: What is wrong!!!!
                        jak9942 Level 1
                        it is no working so that the check box is selected but when the text field is changed to "no" it is still selected, (it is changed before the script is executed)
                        • 9. Re: What is wrong!!!!
                          Level 7
                          Hi jak,

                          You'll need to qualify who you're talking to and what you're following
                          up about. In other words...what is not working? What did you try that
                          resulted in this not working?

                          Patrick

                          jak9942 wrote:
                          > it is no working so that the check box is selected but when the text field is changed to "no" it is still selected, (it is changed before the script is executed)

                          --
                          http://www.baynewmedia.com
                          Faster, easier, better...ActionScript development taken to new heights.
                          Download the BNMAPI today. You'll wonder how you ever did without it!
                          Available for ActionScript 2.0/3.0.
                          • 10. Re: What is wrong!!!!
                            kglad Adobe Community Professional & MVP
                            the text property of your textfield is att_flashintro_txt.text.

                            and because your trace function is not revealing "yes", you must be considering the wrong textfield in your code or on-stage or both or you're doing something to clear your textfield's text property between the time it's "yes" and the time your code executes.
                            • 11. Re: What is wrong!!!!
                              jak9942 Level 1
                              sorry, im not very experienced with flash, i dont understand, how can i resolve this
                              • 12. Re: What is wrong!!!!
                                jak9942 Level 1
                                This works. this time it displays

                                _level0.att_flashintro_txt
                                Type is: object
                                Text value is: This is the real text field

                                but i can visually see the text field as yes

                                quote:

                                Originally posted by: Newsgroup User
                                Hi Jak...

                                Just before this block of code, try this:

                                trace (att_flashintro_txt);
                                trace ('Type is: '+typeof(att_flashintro_txt));
                                trace ('Text value is: '+att_flashintro_txt.text);

                                ...What do you see? Suspect you're probably targetting a non-existent
                                object here.

                                Patrick

                                jak9942 wrote:
                                > i am using this code to make a check box become selected if a text box contains
                                > the word "yes" for some reason it is not working.
                                >
                                > if (att_flashintro_txt.text="yes") {
                                >
                                > att_flashintro_cb.selected = true;
                                > } else {
                                > att_flashintro_cb.selected = false;
                                > }
                                >

                                --
                                http://www.baynewmedia.com
                                Faster, easier, better...ActionScript development taken to new heights.
                                Download the BNMAPI today. You'll wonder how you ever did without it!
                                Available for ActionScript 2.0/3.0.



                                • 13. What is wrong!!!!
                                  jak9942 Level 1
                                  I seem to have solved this.there was some linkage problems because of some previous script. Sorry. if anyone needs this script here it is.


                                  thanks
                                  • 14. Re: What is wrong!!!!
                                    kglad Adobe Community Professional & MVP
                                    oops, we all missed that use of the assignment operator (=) instead of the comparison operator (==).