8 Replies Latest reply on Dec 20, 2006 7:51 AM by cinemaguy

    Embedded Fonts with HTML

      So I have a textfield I've created in AS using createTextField. I've set embedFonts to true and all of that part works fine. My font shows up and it works. My question though is how do I get my HTML formatting to show up in this textfield? I understand why it's not working, I'm just not sure what the work around for it. For example, my embedded font is Arial, 12pt, no bold, no italics. So if i'm setting my html to true and setting my htmlText = "<b>this should be bold</b>", it's not bold. Does anyone have the solution for embedding fonts and keeping your HTML formatting? I need to embed the font because I'm doing alpha tweens on the MC that contains the textfield. So PLEAASEE if anyone has the answer to this (i'm suprised it's not a more common problem) please help me out, I'd appreciate it! THANKS!

        • 1. Re: Embedded Fonts with HTML
          cinemaguy Level 1
          place another dynamic text field way off to the side of the stage. embed your font (Arial 12 Bold) and it should work now. not a pretty solution but effective.
          • 2. Embedded Fonts with HTML
            .:}x-=V!P=-x{:. Level 3
            you need to set embedFont to false unless you embed the bold font also.... I believe.
            • 3. Re: Embedded Fonts with HTML
              BeniRose Level 1
              Thanks for your quick reply guys. The point of it is that I will have all sorts of HTML formatting in a single textfield. For example I may have something like this:

              <p align='center'><b>THIS JUST IN!</b></p>
              There's a <i>new</i> place to do whatever you like to do.

              Let's say I wanted that to be my htmlText of my textfield, but I need to embed the font so I can tween the alpha. Is this possible? Can you embed more than one font? Can I embed the bold and italics also? Even more so, if there's ever a font tag, I'm deadly afraid of what might happen.

              One solution I haven't considered is changing the textfield type to static. I'm only going to be setting the htmlText attribute once, so I don't know if you can make a textfield created with createTextField a static one. If I could, then I could alpha fade it without embedding fonts.

              Anyways, let me know any other ideas you guys come up with now that I've made the problem more clear. Thanks again!!

              • 4. Re: Embedded Fonts with HTML
                BeniRose Level 1
                Nevermind on that alternative solution. I didn't realize you can only set a textfield's type to "dynamic" or "input", which make sense. I was thinking "how can you set a static text once it's been dynamic" so that answers that question!

                So I'm back to square one. Hopefully someone will read this who has tried to use HTML in a textfield that is embedding fonts and can help out. Thanks a lot!
                • 5. Re: Embedded Fonts with HTML
                  cinemaguy Level 1
                  Beni I have done exactly what you are wanting to do and it works great so you should just try it.

                  place three new dynamic text fields way off to the side of the stage. embed your font (Arial Bold, Arial Bold Italic, Arial Italic) and it should work now. not a pretty solution but effective.

                  You will now have four fonts embedded, Arial, Arial Bold, Arial Italic, Arial Bold Italic

                  You can use the font tag to change size and color if you want to change the face you will have to embed the Fonts that you want to support as well. Good luck.
                  • 6. Re: Embedded Fonts with HTML
                    BeniRose Level 1
                    I want to be able to use all of those embedded fonts in ONE textfield. Is simply embedding them in textfields to the side of my movie going to allow the textfield that's only embedding one of the fonts to use all of them (bold, italics, etc)? I can't just switch them out whenever a bold tag comes along, because it will be mixed in with some non-bold stuff. I'll give it a shot and hopefully it will work! Thanks!

                    • 7. Re: Embedded Fonts with HTML
                      BeniRose Level 1
                      It still doesn't work. I tried it in both AS and physically putting the 4 text fields in my frame1. I'm using Times, not Arial, unfortunately. And I don't want to change the bold by switching fonts with the font tag, I want to use the b and i tags. The client isn't going to know from switching fonts, but teaching them b and i tags are easy. I wish there was a way to embed multiple fonts on one textfield, so I could embed the faux-bold and faux-italic outlines of a font as well as the normal outlines into one textfield. Oh well. If I can't figure it out soon, I think I'm just going find another solution other than alpha tweening. I have a solid background colour behind it, so I might be able to fade in box on top of the text, not as a mask, just as a symbol. I'll come up with something good. Thanks for the help though guys, and someone tell Ben Forta this needs to be addressed!! =D