1 Reply Latest reply on May 7, 2010 8:21 AM by kglad

    Passing variables to and from loaded movie clips

    EKonopka

      This is a similar question to a post I made a few days ago, but here is my new (or perhaps, modified) problem (in CS4, Actionscript 2):

       

      I have a movie clip where I store a value in a variable called "yourname" and then load a different .swf file in level 1.  I display the value of "yourname" in a dynamic text box, that works fine.  I then move on to a frame where the user has an input text box and can re-enter a value for the "yourname" variable, and then clicks a button symbol to reassign the value.  Bear in mind, "yourname" was not originally stored on this level and this movie clip, it is stored on level 0 on the first (main) movie clip.  Here is my code in the button:

       

      on (release) {

           _level0.yourname = String (inpt_newName.text);

      }

       

      inpt_newName is the input text box.  My intent here is to have a "main" timeline where variables are stored, and then load and unload various .swf movie clips as needed, storing and variables (i.e. decisions) that the user makes.  The above code is not doing that, and I am having trouble figuring out how to make it work.  Any help would be great!