3 Replies Latest reply on Sep 19, 2007 1:43 PM by Nate_C

    apply AS to existing dynamic text box

      I want to import an external text file into a dynamic text box to preview as a block of text that can be formatted in Flash.

      I have AS to create a text field, and import the external file (see AC below). This works beautifully.
      I also have AS that allows me to apply formatting to text (see AC below).
      I am having trouble doing both (importing AND formatting the same text; see my attempt below).

      I would be happy to create a dynamic text field in Flash, applying text properties to that, and import the text into this field, but am having trouble figuring out how to reference an EXISTING text field in my AS.

      Thanks in advance for any assistance you can provide.

      My system specifications:
      Mac OS 10.4.10
      Flash CS3
        • 1. apply AS to existing dynamic text box
          SymTsb Level 2
          Text formatting has to be applied after the text is loaded and not before.... I've modified your code to do exactly what you needed. Just make sure to change your font back to Treb...

          • 2. Re: apply AS to existing dynamic text box
            Nate_C Level 1
            That did the trick!
            Thanks very much SymTsb.

            I now have another challenge with this script:
            I have the AS inside a MovieClip symbol that moves (Transform). On testing the FLA it gives no error, but the text does not preview.

            It previews when I extract the MC from my FLA, and put it into an empty FLA.

            In the original FLA I have a stop(); action on a bunch of frames, as well as some scripts on Button symbols to add user control. Is there a problem with having scripts sprinkled throughout frames/layers/symbols? I did previously try to consolidate the actions, and didn't have any luck, so I'd rather not, if it's not necessary.

            An other insight into why the script works in isolation, but not when in the overall FLA?

            • 3. Re: apply AS to existing dynamic text box
              Nate_C Level 1
              Amendment to my previous message:
              I have some Actionscripting applied to buttons and MovieClips, which is giving an error on testing.

              Because of this, and to increase viewer compatibility, I would like to Publish my FLA to Flash version 8.0 with Actionscript 2.0, rather than Flash 9.0/AS 3.0.

              SymTsb, can your script be modified to work with Flash 8/Actionscript 2.0?