This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
<span class='location'>San Francisco, CA"; storyText += "Lorem ipsum.
" news_txt.multiline = true; news_txt.wordWrap = true; // true or false, the "html" property doesn't matter here. //news_txt.html = true; // Load CSS file and define onLoad handler: style_sheet.load("html_styles.css"); style_sheet.onLoad = function(ok) { if (ok) { // If the style sheet loaded without error, // then assign it to the text object, // and assign the HTML text to the text field. news_txt.styleSheet = style_sheet; news_txt.text = storyText; } }; The style information ( html_styles.css ) follows: p { color: #0000FF; font-family: Verdana,sans-serif; font-size: 12px; display: inline; } .headline { color: #CC0000; fontFamily: Verdana,sans-serif; fontSize: 16px; fontWeight: bold; display: inline } .location { color: #660000; fontFamily: Verdana,sans-serif; fontSize: 10px; fontWeight: normal; display: inline }Click me now!!
Hithere!'; And, yes, myStyle.parse(copy); works just the same (only parseCSS() is documented). Just FYI, here is the code for stylesheets to TextFormat (also undocumented): var styleObj:Object = style_sheet.getStyle(".headline"); var tf:TextFormat = style_sheet.transform(styleObj);