Guest User

Untitled

a guest
Jun 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. import TextField.StyleSheet;
  2.  
  3. var cssStyle = new TextField.StyleSheet();
  4. cssStyle.load("xml/about_us_style.css");
  5. cssStyle.onLoad = function() {
  6. xmlData.load("xml/about_us.xml");
  7. // content_mc.content_txt.styleSheet = cssStyle;
  8. };
  9.  
  10. // Load XML Data //
  11. function loadXML(loaded) {
  12. if (loaded) {
  13. xmlNode = this.firstChild;
  14. content_txt = [];
  15. total = xmlNode.childNodes.length;
  16. for (i=0; i<total; i++) {
  17. content_txt[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
  18. content_mc.content_txt.html = true;
  19. content_mc.content_txt.autoSize = true;
  20. content_mc.content_txt.condenseWhite = true;
  21. content_mc.content_txt.selectable = false;
  22. content_mc.content_txt.antiAliasType = "advanced";
  23. content_mc.content_txt.gridFitType = "pixel";
  24. content_mc.content_txt.sharpness = 50;
  25. content_mc.content_txt.htmlText = content_txt[0];
  26. content_mc.content_txt.embedFonts = true;
  27. var fmt:TextFormat = new TextFormat();
  28. fmt.font = "Arial";// the font name
  29. content_mc.content_txt.setNewTextFormat(fmt);
  30. content_mc.content_txt.styleSheet = cssStyle;
  31.  
  32.  
  33. }
  34. } else {
  35. errorMsg.text = "Error loading XML";
  36. }
  37. }
  38. xmlData = new XML();
  39. xmlData.ignoreWhite = true;
  40. xmlData.onLoad = loadXML;
  41. //xmlData.load("xml/about_us.xml");
Add Comment
Please, Sign In to add comment