Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import TextField.StyleSheet;
- var cssStyle = new TextField.StyleSheet();
- cssStyle.load("xml/about_us_style.css");
- cssStyle.onLoad = function() {
- xmlData.load("xml/about_us.xml");
- // content_mc.content_txt.styleSheet = cssStyle;
- };
- // Load XML Data //
- function loadXML(loaded) {
- if (loaded) {
- xmlNode = this.firstChild;
- content_txt = [];
- total = xmlNode.childNodes.length;
- for (i=0; i<total; i++) {
- content_txt[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
- content_mc.content_txt.html = true;
- content_mc.content_txt.autoSize = true;
- content_mc.content_txt.condenseWhite = true;
- content_mc.content_txt.selectable = false;
- content_mc.content_txt.antiAliasType = "advanced";
- content_mc.content_txt.gridFitType = "pixel";
- content_mc.content_txt.sharpness = 50;
- content_mc.content_txt.htmlText = content_txt[0];
- content_mc.content_txt.embedFonts = true;
- var fmt:TextFormat = new TextFormat();
- fmt.font = "Arial";// the font name
- content_mc.content_txt.setNewTextFormat(fmt);
- content_mc.content_txt.styleSheet = cssStyle;
- }
- } else {
- errorMsg.text = "Error loading XML";
- }
- }
- xmlData = new XML();
- xmlData.ignoreWhite = true;
- xmlData.onLoad = loadXML;
- //xmlData.load("xml/about_us.xml");
Add Comment
Please, Sign In to add comment