3 Replies Latest reply on Jun 23, 2009 6:28 AM by Ned Murphy

    help on Passing variable from scene to movie clip

    h0n0ka

      Hi all

       

      I have a problem with my actionscript. I can't pass the variable from scene 1 textbox to a movie clip textbox.

      My scene 1 textbox has a name of resultText. My movie clip is call over_mc which is on the symbols definition.

      the textbox for the movie clips is call finalResultText.

       

      here is my code:

      _root.over_mc.finalResultText.text = resultText.text;

       

       

      what's the problem and where should i put this at?

       

      I really need help on this!

       

      Thanks in advance!

        • 1. Re: help on Passing variable from scene to movie clip
          Ned Murphy Adobe Community Professional & MVP

          Explain how each element is located with respect to the main timeline.  You said that resultText is a movie clip textbox, but your code doesn't indicate that.  It is targeting it as just a textbox, not a movieclip containing a textbox.  If it was a mmovieclip textbox then the code would look more like...

           

          _root.over_mc.finalResultText.text = text_mc.resultText.text;

           

          Where text_mc represents whatever instance name of the movieclip that has the textbox

          • 2. Re: help on Passing variable from scene to movie clip
            h0n0ka Level 1

            ok.. for ResultText.text right.. it is a hidden textbox located in a main timeline.

            then for FinalResultText.text, it is located at a movie clips.

             

            I'm doing an application when i click on the search button, it will pass the variable for ResultText.text to the FinalResultText.text.

            • 3. Re: help on Passing variable from scene to movie clip
              Ned Murphy Adobe Community Professional & MVP

              If the button is loactaed on the main timeline, then the code you showed may be correct...

               

              over_mc.finalResultText.text = resultText.text;

               

              though your instance names are questionable since you are spelling them differently between your first and second postings (capital letters?).  So make sure you are using the names properly.  Also, you may want to put a trace inside the search button code to make sure that it is working as a button.