9 Replies Latest reply on Sep 20, 2011 11:30 PM by kglad

    Type Here

    Ron Colmen Level 2

      1. In my submit form, how do I display "Type Here" when a text field is blank? and when the user begins typing, how can make "Type Here" disappear?

       

      2. if I have a button on the root, can I assign an onRelease action to it from _root.main_mc.sub_mc.holder_mc? I've tried but no luck. Is this possible?

        • 1. Re: Type Here
          kglad Adobe Community Professional & MVP

          if your textfield has instance name tf, use:

           

           

          tf.text="Type Here";

           

          tf.onSetFocus=function(){

          if(this.text=="Type Here"){

          this.text="";

          }

          }

           

          ////////////////////////

           

          if your button on the main timeline has instance name btn, you can use the following from any timeline, as long as your button exists when the code exectes:

           

          _root.btn.onRelease=function(){

          //whatever

          }

          • 2. Re: Type Here
            Ron Colmen Level 2

            Thanks Kglad.

            • 3. Re: Type Here
              kglad Adobe Community Professional & MVP

              you're welcome.

              • 4. Re: Type Here
                Ron Colmen Level 2

                How do I execute two actions in two different movieclips in to one button?

                 

                // in main_mc.sub_mc1

                _root.next_btn.onRelease = function(){

                   getNames(selectedItemN);

                   displayScore(selectedItemN,false);

                   _root.gotoAndStop (10)

                }

                 

                //in main_mc.sub_mc5

                _root.next_btn.onRelease = function(){

                   getNames(selectedItemN);

                   displayPosition(positionN,false);

                  _root.gotoAndStop (10)

                }

                • 5. Re: Type Here
                  kglad Adobe Community Professional & MVP

                  one button can't be in two different movieclips.  you could drag one button from your library and place it into any number of different movieclips.  that would give you any number of different buttons.

                   

                  you could then use:

                   

                   

                   

                  // if there is a next_btn in _root.main_mc.sub_mc1

                  _root.main_mc.sub_mc2.next_btn.onRelease = function(){

                     getNames(selectedItemN);

                     displayScore(selectedItemN,false);

                     _root.gotoAndStop (10)

                  }

                   

                  // if there is a next_btn in in _root.main_mc.sub_mc5

                  _root.main_mc.sub_mc5.next_btn.onRelease = function(){

                     getNames(selectedItemN);

                     displayPosition(positionN,false);

                    _root.gotoAndStop (10)

                  }

                  • 6. Re: Type Here
                    Ron Colmen Level 2

                    Thanks Kglad. But I'm looking for a way to combine all of these actions in to single button?

                     

                    _root.onRelease = function(){

                       getNames(selectedItemN); //actions in _root.main_mc.sub_mc1

                       displayScore(selectedItemN,false);//actions in _root.main_mc.sub_mc1

                     

                    getNames(selectedItemN);//actions in _root.main_mc.sub_mc5

                       displayPosition(positionN,false);//actions in _root.main_mc.sub_mc5

                     

                       _root.gotoAndStop (10)

                    }

                     

                    Message was edited by: Ron Colmen

                    • 7. Re: Type Here
                      kglad Adobe Community Professional & MVP

                      :

                       

                       

                      _root.btn.onRelease = function(){

                         _root.main_mc.sub_mc1.getNames(selectedItemN);

                         _root.main_mc.sub_mc1.displayScore(selectedItemN,false);

                       

                      _root.main_mc.sub_mc5.getNames(selectedItemN);

                         _root.main_mc.sub_mc5.displayPosition(positionN,false);

                       

                         _root.gotoAndStop (10)

                      }

                       

                      1 person found this helpful
                      • 8. Re: Type Here
                        Ron Colmen Level 2

                        Thanks Kglad.

                        • 9. Re: Type Here
                          kglad Adobe Community Professional & MVP

                          you're welcome.