7 Replies Latest reply on Jun 11, 2009 8:49 AM by kglad

    changing font size

    Pe_ka
      Hi,
      I have a text field (not component text), Dynamic Text, and want to change the font text via actionscript. I just cant find out how to do that, can anyone nice please advice?

      Cheers
        • 1. Re: changing font size
          fdarweesh
          Hello:

          inside Properties --> under Dynamic Text put any name to the instance name example text1

          after that inside the first frame of the main time line

          put

          test1.text=" my test";

          that is all

          regards
          • 2. changing font size
            shikozel Level 1
            you can render your text field to read HTML. then you just feed the textfield with HTML code:
            text2.html = true;
            text2.htmlText = "<font size=11> this is bold text </font>";

            • 3. Re: changing font size
              ReaperMedia Level 1

              Here you go:

              //Enter Your Preferences Here:
              desiredFontTypeface = "Arial"
              desiredFontSize = "20"
              desiredFontColor = "#00ccff" //To not change the color, set this to "defaultColor"
              instanceNameOfTextbox = "myTextbox"
              
              //Don't edit below this line
              //-- START --
              tempText = this[instanceNameOfTextbox].text
              this[instanceNameOfTextbox].html = true
              if(desiredFontColor == "defaultColor"){
                   this[instanceNameOfTextbox].htmlText = '<font size="' + desiredFontSize + '" face="' + desiredFontTypeface + '">' + tempText + '</font>';
              } else {
                   this[instanceNameOfTextbox].htmlText = '<font color="' + desiredFontColor + '" size="' + desiredFontSize + '" face="' + desiredFontTypeface + '">' + tempText + '</font>';
              }
              //-- END --
              
              • 4. Re: changing font size
                kglad Adobe Community Professional & MVP

                lol.

                 

                there's no point in responding to messages that are 3 years old.

                • 5. Re: changing font size
                  Ned Murphy Adobe Community Professional & MVP

                  Now now, I'm sure that after waiting a full year for just the first reply, Pe ka is still waiting for a good answer.

                   

                  I'm noticing a few people replying to years old posts, asking questions to the poster even... I can only wonder.

                  • 6. Re: changing font size
                    ReaperMedia Level 1

                    Whoops, didn't notice the date lol

                     

                    Came up on search engine on google

                     

                    I think i've done this with another post aswell

                    • 7. Re: changing font size
                      kglad Adobe Community Professional & MVP

                      that was pretty funny, reaperm.