3 Replies Latest reply on Apr 17, 2009 2:47 PM by Ned Murphy

    create a duplicate of a button and change the text on THAT button only

    DPSwebmaster Level 1

      something is frustrating me w/Flash. Not sure if there is a workaround within Flash itself or not. I have a group of buttons with fancy backgrounds and text. They may have originally been imported from Ilustrator, but are now MC's. I tried to select one in the library, right click (on PC) and duplicate. This does create a new instance. I give the new instance a different name and drag onto the stage. When I change the test though it changes the text ALSO on the button which I duplicated from. Don't want this. Each button needs to have it's own unique text. Is there a way to accomplish this in Flash? I know one alternative is to try and find the Illustrator template and create a new one, but I would rather not do this if possible.

       

      TIA

        • 1. Re: create a duplicate of a button and change the text on THAT button only
          MATTANDIE Level 1

          This could be happening for a couple of reasons. The good news is its easily fixable, and you have options.

           

          Option 1.

          From your explanation of the problem I am assuming you are using static text inside your MCs.

           

          First, find out what's really happening with your two mcs.

           

          make sure you aren't using 2 of the same clip (either the original or the duplicate).Not the  instance names, but the actual names of the clip as found in the Library.

           

          If they are different, i.e. "myclip" and "copy of myClip", then odds are there is another mc that holds your text inside them. So, go into either one of your movie clips and check for nested movie clips inside them. If there are nested clips, you need to duplicate each of those clips as well otherwise you will continue to have the text change in both.

           

          Option 2.

           

          if you are ok with a little bit of scripting, you can just go inside your mc and make your text fields "dynamic" and give it an instance name.

           

          then open up the actions panel, create new layer, and add the following frame script:

           

          //insert your instance names where necessary

           

          myMC.pathToMyTextField.myTextField.text = "the text for this button";

           

          do this for each button and it should fix your issue.

           

           

          hope this helps.

           

          M.

          • 2. Re: create a duplicate of a button and change the text on THAT button only
            DPSwebmaster Level 1

            thanks for the reply. It looks like I am using a graphics instance, so two have that same instance. I might resort to the AS solution. I have the FLA set up for AS 1 or 2. Should I place the AS on the button, or the main timeline?

            • 3. Re: create a duplicate of a button and change the text on THAT button only
              Ned Murphy Adobe Community Professional & MVP

              If you are using button symbols, that option won't stand.  You cannot assign something to a textfield inside a button symbol.  If you are using movieclips as buttons then you can take that route and the code should go in the timeline where the movieclip-buttons are (ideally).