CSS with dynamically loaded txt

  • starqueen
  • Graduate
  • Graduate
  • User avatar
  • Posts: 122

Post 3+ Months Ago

Alright, so I can't seem to figure it out. I followed some tutorials and what not and combined a few, it looks like it should work but it doesn't. Basically I'm loading a .txt file into a dynamic text box while trying to use a .css stylesheet as well. (I want it all!)

Code: [ Select ]
loadText = new loadVars();
loadText.load("news.txt");
var format = new TextField.StyleSheet();
var path = "news.css";
var quick = this.newstext;
format.load(path);
format.onLoad = function(loaded) {
    if (loaded) {
        scroller.styleSheet = format;
        scroller.text = quick;
    } else {
        scroller.text = "Error loading CSS file!";
    }
};
  1. loadText = new loadVars();
  2. loadText.load("news.txt");
  3. var format = new TextField.StyleSheet();
  4. var path = "news.css";
  5. var quick = this.newstext;
  6. format.load(path);
  7. format.onLoad = function(loaded) {
  8.     if (loaded) {
  9.         scroller.styleSheet = format;
  10.         scroller.text = quick;
  11.     } else {
  12.         scroller.text = "Error loading CSS file!";
  13.     }
  14. };


I tried combing 2 tutorials into one and I realize it looks nasty, how can I clean it up to work? thanks in advance
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • rynoe
  • Banned
  • Banned
  • User avatar
  • Posts: 17

Post 3+ Months Ago

Unless you have 2004 and there is something new that I dont know about you cannot import css into actionscript. You can load for a data file or use xml functions for xml but not directly from css.
  • starqueen
  • Graduate
  • Graduate
  • User avatar
  • Posts: 122

Post 3+ Months Ago

http://www.kirupa.com/developer/mx2004/cssfile.htm

Yes, it's new for MX2004. Thanks though for replying.... I have chosen to go another route afterall.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 22 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.