1 Reply Latest reply on Jun 5, 2006 5:23 PM by Newsgroup_User

    Load Vars takes away my html formatting!

      Hello All....

      I followed a tutorial which showed my how to use the loadvariables function, which I used to load text from a text file with HTML formatting. The problem with that is I could not link it to my UI Scrollbar. So I followed another tutorial which allowed me to ty the text box with the UIScrollbar. The second tutorial uses loadvars instead of load variables, but.... It does not accept my htnl formatting. I made sure the text box is checked to allow HTML formatting, and I even tried to do it with Actionscript, but cannot get it to work...

      Here is my code...

      _scrolltext.html=true;
      _scrolltext.htmlText = this.hipaacontent
      _scrollbar.setScrollTarget(_scrolltext);

      // Size it to match the text field.
      _scrollbar.setSize(16, _scrolltext._height);

      // Move it next to the text field.
      _scrollbar.move(_scrolltext._x + _scrolltext._width, _scrolltext._y);

      // Load text to display and define onData handler.
      var my_lv:LoadVars = new LoadVars();
      my_lv.onData = function(src:String) {
      if (src != undefined) {
      _scrolltext.text = src;
      } else {
      _scrolltext.text = "Error loading text.";
      }
      };
      my_lv.load("hipaa.txt");
      ;

        • 1. Re: Load Vars takes away my html formatting!
          Level 7
          _scrolltext.htmlText = src; is needed for html rendering.




          --
          Lon Hosford
          www.lonhosford.com
          Flash, Actionscript and Flash Media Server examples:
          http://flashexamples.hosfordusa.com
          May many happy bits flow your way!
          "Dan Raborn" <webforumsuser@macromedia.com> wrote in message
          news:e61m0v$qrc$1@forums.macromedia.com...
          Hello All....

          I followed a tutorial which showed my how to use the loadvariables
          function,
          which I used to load text from a text file with HTML formatting. The
          problem
          with that is I could not link it to my UI Scrollbar. So I followed another
          tutorial which allowed me to ty the text box with the UIScrollbar. The
          second
          tutorial uses loadvars instead of load variables, but.... It does not accept
          my
          htnl formatting. I made sure the text box is checked to allow HTML
          formatting,
          and I even tried to do it with Actionscript, but cannot get it to work...

          Here is my code...

          _scrolltext.html=true;
          _scrolltext.htmlText = this.hipaacontent
          _scrollbar.setScrollTarget(_scrolltext);

          // Size it to match the text field.
          _scrollbar.setSize(16, _scrolltext._height);

          // Move it next to the text field.
          _scrollbar.move(_scrolltext._x + _scrolltext._width, _scrolltext._y);

          // Load text to display and define onData handler.
          var my_lv:LoadVars = new LoadVars();
          my_lv.onData = function(src:String) {
          if (src != undefined) {
          _scrolltext.text = src;
          } else {
          _scrolltext.text = "Error loading text.";
          }
          };
          my_lv.load("hipaa.txt");
          ;