7 Replies Latest reply: Jun 21, 2012 12:34 PM by Ned Murphy RSS

    how to use same dynamic text, multiple times in a Movie

    DaLe Zki Community Member

      FLASH CS5.5

       

      How can a dynamic text field be used multiple times, on any

      frame, in any new layer during a Movie?

      ~~

       

      A number of unique dynamic text fields are being used.

      The intent is to use them each, many times during a Movie.

      (i.e. a users first name)

       

      They are successfully being "ExternalInterfaced" from a PDF form field.

      (the SWF is displayed within the PDF as a RMA)

       

      This all works well, IF I only use one instance of the dynamic text field.

      (one use of each unique text field)

       

      If I try and use that same dynamic text field, again, in a new layer, later in the SWF,

      all of that said, duplicate dynamic text fields do not display.

      ~~

       

      Stumped!!!

       

      Thanks in advance for your advice / comments!

       

      D-

        • 1. Re: how to use same dynamic text, multiple times in a Movie
          Ned Murphy MVP

          If you are not reassigning text to the new instances, they have nothing to display -  they do not inherit content by name alone.  You need to store the text in variables and make those variables accessible for the length of the timeline.  So when you come to a frame with a new instance of a textfield, you assign it the text that beongs to it from the variable.

          • 2. Re: how to use same dynamic text, multiple times in a Movie
            DaLe Zki Community Member

            Thank you Ned.

             

            For clarity (example), if I have a single dynamic text (say with an instance

            of  "textswf_1" ) and wish to use it multiple times over the time line,

            I will need to store this text in a variable.

             

            True?

             

            Or can a dynamic instance only be used once?

            (i.e. ... a new text instance, reference is required for

            multiple use of the original text field)

             

            If so, would you mind referencing a resource or an

            example - how to (the variable and it's use)?

             

            Thanks again for your response!

             

            D-

            • 3. Re: how to use same dynamic text, multiple times in a Movie
              Ned Murphy MVP

              If you have a single dynamic instance of a textfield, then there is only one of them, then you are not using it multiple times over the timeline.  You can extend whatever layer it is on to have it present whereever you want it to be.  If there are frames where you do not want it to appear, then you can set its visible property to false/true as needed.

               

              Anytime you create a new keyframe with that textfield in it, you are creating a new instance.  It is not the same single textfield anymore, regardless that you name it the same.  If it happens to be in an adjacent frame to a copy of it, it can inherit the properties of the one preceding it, but it is still a new instance.  If you separate it by frames or layers, then it has no association with the original.

               

              You described having the textfield on different layers.  That indicates there cannot be a single instance of it.

              • 4. Re: how to use same dynamic text, multiple times in a Movie
                DaLe Zki Community Member

                Thanks Ned,

                 

                I always welcome learning something new.

                 

                I did not know creating a new keyframe,

                creates a new instance.

                 

                Yes, I had used the same dynamic text field instance name in

                numerous, new layers (great observation).

                 

                With the objective to display the User's name throughout

                the timeline (on and off)...

                 

                I'll attempt to paraphrase your solution;

                 

                • Use a single layer to display the dynamic text field.
                • Extend this layer's timeline throughout the movie, or end use of the dynamic text field.

                 

                Help with this one ??

                • Set the visible properties to true or false as need through out the timeline.

                ( Does require an AS3 ? )

                 

                I'll give that a try.....

                ~~

                 

                Side of effect of using the above solution;

                 

                The SWF in it's attempted state, uses the dynamic text field instance, in

                different places, different text sizes, on the stage, throughout the Movie.

                 

                (i.e. the User's first name appears in different sentences...)

                 

                Per the solution above,

                I believe I will be limited to One location, one format setting.

                Is this assumption correct?

                 

                I can make this work from a display / Movie point of view.

                 

                However, your first VAR concept, noted above, might be

                worth exploring should more flexibility be required.

                 

                Thanks for making the time to coach...

                 

                D-

                • 5. Re: how to use same dynamic text, multiple times in a Movie
                  Ned Murphy MVP

                  Declare a variable for the text that will be displayed in the textfield(s).  Place that variable in an actions layer that extends the full length of the timeline.  That will make it available anywhere along the timeline. 

                   

                      var yourText:String;

                   

                  At whatever point some text is defined for that textfield, assign the text to the variable.

                   

                      yourText = "the text for the textfield";   // or maybe = theInputTextfield.text

                   

                  Then anywhere along that timeline where you have a new textfield for that text to be displayed, use Actionscript in that actions layer to assign it in the frame where it is needed.

                   

                      yourTextfieldName.text = yourText;

                  • 6. Re: how to use same dynamic text, multiple times in a Movie
                    DaLe Zki Community Member

                    Thanks again Ned,

                     

                    I will explore both of your solutions within this Project.

                     

                    ... appreciate your time!

                     

                    D-