Frage

Using the following code, I push data from an xml file into a classic dynamic text box that is configured to render text as html. For some reason there is an obscene amount of white space between paragraphs. I am not sure why it is there since I have already set it to ignore white space. How would I get rid of it?

package  {

    import flash.display.*;
    import flash.events.*;
    import flash.net.*;

    public class Blog extends MovieClip {

        var rssLoader:URLLoader = new URLLoader();
        var rssURL:URLRequest = new URLRequest("http://www.woot.com/blog/rss.aspx");
        var rssXML:XML = new XML();

    public function Blog() {
        //Load RSS file
        rssLoader.addEventListener(Event.COMPLETE, blogBuilder);
        rssLoader.load(rssURL);
        rssXML.ignoreWhitespace = true;
    }

    public function blogBuilder(e:Event):void {
        rssXML = XML(rssLoader.data);

        //Adds data to blog
        titleBox.text = rssXML.channel.item[0].title;
        dateBox.text = rssXML.channel.item[0].pubDate;
        textBox.htmlText = rssXML.channel.item[0].description;
    }
}
War es hilfreich?

Lösung

try this:

rssXML = XML(rssLoader.data);
rssXML.ignoreWhite = true;
titleBox.condenseWhite = true;
dateBox.condenseWhite = true;
textBox.condenseWhite = true;
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top