0 Replies Latest reply on Dec 4, 2006 8:29 AM by imageboxmiami

    CSS formated HTML in Flash 8

    imageboxmiami
      I am having trouble with CSS formated HTML in Flash 8. Specifically, with LoadVars() and TextField.StyleSheet(). The problem I am having is that the CSS formatting only works intermitently.

      To see the effect go to http://www.mellowdrama.com
      Click movies>411>then click around in any of the right menu links (apart from preview) you'll see that the css styles apply intermitently.

      I have the following code on frame one of the timeline for each movieclip where I am loading an HTML and CSS file:

      var flash_css = new TextField.StyleSheet();

      flash_css.load("styles.css");
      flash_css.onLoad = function(success:Boolean) {
      if (success) {
      my_txt.styleSheet = flash_css;
      lv.load("theHTMLfile.htm");
      } else {
      trace("Could not load CSS file.");
      }
      };

      var lv:LoadVars = new LoadVars();
      lv.onData = function (src:String):Void {
      if (src != undefined) {
      my_txt.html=true;
      my_txt.htmlText = src;
      this.setDepthTo(DepthManager.kBottom);
      } else {
      my_txt.text = "Unable to load external file.";
      }
      }

      On frame 2 I have a stop();

      Any help is greatly appreciated.