WHAT'S NEW?
Loading...

load xml textAutosize height


var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("faq.xml"));
xmlLoader.addEventListener(Event.COMPLETE, onXMLLoad, false, 0, true);

function onXMLLoad(event:Event):void
{
 var newsXML:XML = new XML(event.target.data);
 var n:int = newsXML.item.length();

 for (var i:int = 0; i < n; i++)
 {

  var tile:Tile = new Tile();

  tile.headerTxt.htmlText = newsXML.item[i].name.text();
  //get content from <txt> tags. Then add data from <linkurl> and <linkname>
  tile.infoTxt.htmlText = newsXML.item[i].txt.text()+" <font color='#FFFFFF'> <a href='"+newsXML.item[i].linkurl.text()+"'>"+newsXML.item[i].linkname.text()+"</a></font>";

  tile.infoTxt.multiline = true;
  tile.infoTxt.autoSize = TextFieldAutoSize.LEFT;
  tile.infoTxt.width = 610;
  tile.y = scrlContainer.height;

  trace("tile " + i + " y position: " + tile.y);
  trace("tile "  + i + " height property = " + tile.height);
  trace("");

  scrlContainer.addChild(tile);
 }
}