Skip navigation
Currently Being Moderated

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

Jun 20, 2012 7:24 PM

Tags: #flash #pro #text #as3 #cs5.5 #swf #dynamic #action_script_3 #actionscript #multiple #flash_cs5.5 #dynamic_text #uses

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-

 
Replies
  • Currently Being Moderated
    Jun 21, 2012 4:51 AM   in reply to DaLe Zki

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 21, 2012 9:01 AM   in reply to DaLe Zki

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 21, 2012 10:48 AM   in reply to DaLe Zki

    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;

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 21, 2012 12:34 PM   in reply to DaLe Zki

    You're welcome

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points