1 Reply Latest reply on May 30, 2006 3:26 AM by Newsgroup_User

    "this.createTextField" font change?

    Blakice_iceman Level 1
      Hello,

      Newb to Flash, but I am wondering if I can select a certain font and font size for the following code:

      this.createTextField("home_txt", this.getNextHighestDepth(), 20, 30, 320, 260);
      home_txt.multiline = true;
      home_txt.wordWrap = true;
      for (var i = 0; i<10; i++) {
      home_txt.text = "Just some test text for the site.";
      }
      goUp.onPress = function() {
      home_txt.scroll--;
      scroll_txt.text = home_txt.scroll+" of "+home_txt.maxscroll;
      };
      goDown.onPress = function() {
      home_txt.scroll++;
      };

      Is it even possible to change that font, and if so, how? Thank you in advance!

      Elijah
        • 1. Re: &quot;this.createTextField&quot; font change?
          Level 7


          Blakice_iceman wrote:
          > Hello,
          >
          > Newb to Flash, but I am wondering if I can select a certain font and font size
          > for the following code:
          >
          > this.createTextField("home_txt", this.getNextHighestDepth(), 20, 30, 320, 260);
          > home_txt.multiline = true;
          > home_txt.wordWrap = true;
          > for (var i = 0; i<10; i++) {
          > home_txt.text = "Just some test text for the site.";
          > }
          > goUp.onPress = function() {
          > home_txt.scroll--;
          > scroll_txt.text = home_txt.scroll+" of "+home_txt.maxscroll;
          > };
          > goDown.onPress = function() {
          > home_txt.scroll++;
          > };
          >
          > Is it even possible to change that font, and if so, how? Thank you in
          > advance!
          >
          > Elijah
          >


          With text object you will need to place the font in library than give it
          linkage name and than use that name to be able to call it.

          Open library CTRL L, in the top right side menu look for NEW FONT.
          Find one you want to use, select it. It will now appear in the library.
          Select that font and right click, go to linkage, select the export for action
          script option and give it some ID name.

          Here is how you would use it :


          myFormat = new TextFormat();
          myFormat.size = 20;
          myFormat.font = "IDnameComesHere";
          myFormat.color = 0x000000;
          this.createTextField("TextFieldInstanceName", this.getNextHighestDepth(), 10, 10, 100,22);
          TextFieldInstanceName.text = "Whatever";
          TextFieldInstanceName.embedFonts = true;;
          TextFieldInstanceName.setTextFormat(myFormat);



          --
          Regards

          Urami


          --



          Happy New Year guys - all the best there is in the 2006




          <urami>
          http://www.Flashfugitive.com
          </urami>

          <web junk free>
          http://www.firefox.com
          </web junk free>