Posted By

stiobhart on 06/07/09


Tagged

css actionscript flash xml load


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

adrianparr


actionscript - load in XML [with attached stylesheet info]


 / Published in: ActionScript
 

load in XML and style the text via CSS

  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  

You need to login to post a comment.