actionscript - load in XML [with attached stylesheet info]


/ Published in: ActionScript
Save to your folder(s)

load in XML and style the text via CSS


Copy this code and paste it in your HTML
  1. // init TextArea component
  2. blurb.html = true;
  3. blurb.wordWrap = true;
  4. blurb.multiline = true;
  5. blurb.label.condenseWhite=true;
  6.  
  7. // load CSS
  8. madrastyle = new TextField.StyleSheet();
  9. madrastyle.load("madra.css");
  10. blurb.styleSheet = madrastyle;
  11.  
  12. // load in XML
  13. XMLcontent = new XML();
  14. XMLcontent.ignoreWhite = true;
  15. XMLcontent.load("kungfu.xml");
  16. XMLcontent.onLoad = function(success)
  17. {
  18. if(success)
  19. {
  20. blurb.text = XMLcontent;
  21. }
  22. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.