How on Earth do you embed font in CS3 TextArea? Adobe documentation team WTF?
While working on my last AS3 project, I wanted to cut my self some slack (spare some time), and instead of building TextField + scroller – use CS3 prebuilt TextArea component. Off course, not only that I didn’t achieve what I intended, I also spent 3 hours trying to figure that shit out.
I figured out that:
- you STILL have to embed fonts if you masked TextArea (TextField too),
- Online Flash CS3 Documentation is not what it should be.
Just, please take a look at the following link (Flash CS3 Documentation > Programming ActionScript 3.0 > Working with text > Advanced text rendering). There is absurd line that says: “The exact method of embedding a font file into your application’s SWF file varies according to your development environment.”. Well, HELLO? What is that page I am looking at then? Adobe’s help site is pretty awful (not as bad as ATI/AMD merged support sites – they are the worst), advanced searching is impossible and ordinary search gives you results that have no meaning. If you are looking for something on Adobe’s site related to Flash9 – my bet is you won’t find it.
7 thoughts on “How on Earth do you embed font in CS3 TextArea? Adobe documentation team WTF?”
September 30, 2007 at 16:38
Flash CS3 is very poorly finished. Not only the docs, but the UI is also slow and buggy. Hope they get their act together and release a patch like they did with MX 2004.
October 1, 2007 at 09:09
Yo C4RL05!!!! LOL! Yes, you still have to hack your way in/out of some situations. I really don’t know how Flex differs in internationalization areas, but I should definitely give it a spin.
I think fellas at Adobe are too busy with plans on how to merge After Effects and Flash, instead of fixing things. Basic things like text rendering for example. :(
May 9, 2008 at 22:16
I got it to work.. First I had to extend the TextArea class. Details found at: http://www.gskinner.com/blog/archives/2008/03/adding_css_supp.html
Then my code had:
var theStyle:StyleSheet = new StyleSheet();
var font:Font = new MyFont();
theStyle.setStyle(“body”, {fontFamily:font.fontName, color:”#644724″, fontSize:12});
theStyle.setStyle(“a”, {color:”#0000FF”});
theStyle.setStyle(“a:hover”, {color:”#0000FF”, textDecoration:”underline”});
desc_ta.setStyle(“embedFonts”, true);
desc_ta.setStyle(“styleSheet”, theStyle); // instance
StyleManager.setStyle(“styleSheet”, theStyle);
And BOOM! CSS styled htmlText in a textArea component!
May 28, 2008 at 02:25
Hmmmm. Two points – 1) It appears to be AS2 compliant only. (In particular the line StyleManager.setStyle(”styleSheet”, theStyle);)
2) If you apply a stylesheet style to a textarea it becomes noneditable, which is useless for many purposes (including mine!)
So I am still seeking a solution as to how to apply a font color or size or type to a textarea
February 24, 2009 at 23:58
http://actionscriptexamples.com/2008/11/26/using-an-embedded-font-with-the-textarea-control-in-flash-with-actionscript-30/
December 20, 2009 at 03:31
Thanks Neil!
adding
var myTextAreaTextField:TextField = textArea.textField;
myTextAreaTextField.antiAliasType = AntiAliasType.ADVANCED;
after
var textArea:TextArea = new TextArea();
solves the antialiasing issue too!
Thanks again