4 Replies Latest reply on Mar 22, 2011 1:16 AM by RuesterProd

    Is it possible to duplicate a button, instead of building a new one each time (navigation)

    RuesterProd Level 1

      In CS5...

       

      I have created a movieclip button which is animated  for all the states I need (up, over, out, etc.) it's made up of text, which is in a movie clip where I have my animations created (actions layer with AS3 script, my txt movieclip layer, my hit layer) and then that is inside a movie clip in my main scene.

       

      Is it possible to copy that button, so then change the text, Actionscript, instance name, etc?

       

      I tried copying the layer (by selecting the frames and copying frames, and pasting to new layer) but when I make any changes, it changes both copies!

       

      Can someone tell me an easy workflow so I don't have to build each button from the ground up each time?

       

      Thanks all!

        • 1. Re: Is it possible to duplicate a button, instead of building a new one each time (navigation)
          Ned Murphy Adobe Community Professional & MVP

          If your button contains other library symbols, then changing those symbols inside the button will change them for all buttons that use them.  So to avoid that don't change library symbols within the button.  If the text inside the movieclip is all that you are changing, then you could make it a dynamic textfield and assign the text to it when the file runs.  That way you don't need to create duplicates that take up space in the library/file.

          1 person found this helpful
          • 2. Re: Is it possible to duplicate a button, instead of building a new one each time (navigation)
            RuesterProd Level 1

            Sorry, I'm a noob...

            but how do I do the Dynamic Text Field?

             

            Thanks Ned!

            • 3. Re: Is it possible to duplicate a button, instead of building a new one each time (navigation)
              Ned Murphy Adobe Community Professional & MVP

              Select the textfield that is inside the movieclip and in the properties panel you should see a dropdown for selecting the type of textfield.  If you select Dynamic and then assign an instance name to the textfield you can use that instance name in your code to assign the text when the file runs.  If you were to name the textfield "tField", then the code you would use inside an instance of your movieclip named "mClip1" would be...

               

              mClip1.tField.text = "your text";

              1 person found this helpful
              • 4. Re: Is it possible to duplicate a button, instead of building a new one each time (navigation)
                RuesterProd Level 1

                Ned Murphy wrote:

                 

                Select the textfield that is inside the movieclip and in the properties panel you should see a dropdown for selecting the type of textfield.  If you select Dynamic and then assign an instance name to the textfield you can use that instance name in your code to assign the text when the file runs.  If you were to name the textfield "tField", then the code you would use inside an instance of your movieclip named "mClip1" would be...

                 

                mClip1.tField.text = "your text";

                So, if I have multiple buttons, using your example, would the code read

                 

                mClip1.tField.text = "your text";

                mClip1.tField2.text = "your text2";

                mClip1.tField3.text = "your text3";

                mClip1.tField4.text = "your text4";

                 

                And my buttons are built inside movieclips, ie

                 

                Main Timeline > aboutButton_mc > aboutText_mc > "about"

                                    > contactsButton_mc > contactsText_mc > "contacts"

                 

                can the code be put at any level, or does it need to reside on the Main Timeline to access all the movie clips' text fields?

                 

                 

                Just in case this may be too complex to get into via this forum, if you know of any good tutorials, that would be awesome too!

                 

                I tried doing a search, but it's so hard to tell if they might be in AS2, or AS3, and if they would apply to newer versions of Adobe Flash (I have CS5)