2 Replies Latest reply on Oct 20, 2008 4:02 PM by alan arthur

    Need syntax for text

    alan arthur
      My third newbie question, sorry. New to Actionscript, but veteran programmer.

      I'm a bit confused about changing text programatically.

      I have a graphic symbol that was built using text, named "but1text".
      I wish to change the text in the symbol dynamically.

      I tried the following code in the frame in which the graphic symbol appears:

      but1text.text = "hello";

      but no joy. No error, no change in the text.
      How do I change the text on-the-fly within a symbol? My intention is to use loadVars to set the text for seven of these.

      Thanks in advance for your help
        • 1. Re: Need syntax for text
          robdillon Most Valuable Participant
          The textfield must be a Dynamic textfield. You need to give it an instance name. If you put the textfield in a movieClip, then you must also name the movieClip instance.

          In either case, you can use the target tool in the Actions window to find the path to the object that you want to address. Then append the .text property as you have above.
          • 2. Re: Need syntax for text
            alan arthur Level 1
            Thanks a million. I looked up "Dynamic Text" in the online help and got 4000 subjects, some of which referred to Dynamic text, none of which explained it.

            Thank you. That's the solution.