
Welcome Guest
|
#1
|
|||
|
|||
|
Embed fonts with Style Sheet
Hi all,
I'm trying to format text using a stylesheet with different fonts. However, I'm having real difficulty getting it to work. Here's the code: Code:
//TRY normal way
this.createTextField("tLabel", this.getNextHighestDepth(),100, 100, 100, 20);
tLabel.text = "abcdefg";
tLabel.embedFonts = true;
var stdText:TextFormat = new TextFormat();
stdText.font = "Verdana";
stdText.bold = false;
stdText.size = 11;
tLabel.setTextFormat(stdText);
//TRY with style sheet
//Set the link style
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.setStyle(".stdtext", {fontFace: "Verdana", fontSize: "11",color: "#373737"});
cssStyles.setStyle(".stdheadline", {fontFace: "Arial", fontSize: "11",color: "#000000"});
_root.createTextField("slide_x",this.getNextHighestDepth(),200, 100, 100, 20);
_root['slide_x'].styleSheet = cssStyles;
_root['slide_x'].multiline = true;
_root['slide_x'].wordWrap = true;
_root['slide_x'].condenseWhite = true;
_root['slide_x'].embedFonts = true;
_root['slide_x']._alpha = 100;
_root['slide_x'].html = true;
_root['slide_x'].htmlText = "<span class='stdheadline'>Font 1</span><span class='stdtext'>Font 2</span>";Cheers, Leon |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A way around having to embed fonts | Scottae | Members Cafe |
7 | 03-18-2009 03:19 PM |
| Embed fonts in multiple text fields? | Coss | Newbies |
6 | 11-18-2008 06:25 PM |
| Dynamic text is not keeping the style sheet | mb81 | General Flash | 6 | 11-27-2006 04:14 PM |
| Problems with dynamic style sheet text in flash player 6 | d60eba | Flash MX |
2 | 11-09-2004 10:54 AM |
| To embed fonts for use in HTML formatted text fields | Scottae | Flash MX ActionScript |
5 | 12-21-2003 08:15 AM |





