A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: External Text Import Displays HTML tags.

  1. #1
    Blue Haired Muppet

    Join Date
    Jul 2000
    Location
    ----->
    Posts
    443

    External Text Import Displays HTML tags.

    Hey Guys,

    Here is an example of what is happening:

    http://www.spinweb.net/index.php?src...s&ref=testhome

    If you click on Shift or Refresh, it will take you to a paragraph, but it is displaying all of the HTML tags in it rather than displaying it correctly. When I test the swf on my computer, it looks just fine. I am even using the direct path to import both the txt file and the css file. Any ideas on this would be most appreciated.

    Thank you!

    Also, here is the actionscript:

    Code:
    //Handle the UIScrollBar - instance in library
    this.createClassObject(mx.controls.UIScrollBar, "my_sb", 20);
    
    // Set the target text field for the scroll bar.
    my_sb.setScrollTarget(my_txt);
    
    // Size it to match the text field.
    my_sb.setSize(16, my_txt._height); 
    
    // Move it next to the text field.
    my_sb.move(my_txt._x + my_txt._width, my_txt._y);
    
    //Note: Download the TXT and CSS files to look at their structure. Use the URLs below.
    //load text
    function loadMyText(evt) {
    	var loadit_lv:LoadVars = new LoadVars();
    	loadit_lv.load("http://www.spinweb.net/graphics/flash/shift.txt");
    	loadit_lv.onLoad = function(success:Boolean) {
    		if (success) {
    			my_txt.text = this.content;
    		} else {
    			trace("Could not load text file.");
    		}
    	};
    }
    loadMyText();
    
    //apply stylesheet
    var flash_css = new TextField.StyleSheet();
    flash_css.load("http://www.spinweb.net/graphics/flash/flash.css");
    flash_css.onLoad = function(success:Boolean) {
    	if (success) {
    		my_txt.styleSheet = flash_css;
    	} else {
    		trace("Could not load CSS file.");
    	}
    };
    Last edited by Xerxes; 12-05-2007 at 11:02 AM. Reason: added actionscript

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Try:

    my_txt.htmlText=this.content;

  3. #3
    Blue Haired Muppet

    Join Date
    Jul 2000
    Location
    ----->
    Posts
    443
    That worked great! Thanks rdoyle720, you are a lifesaver! Much appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center