Hi i have the following code that works perfectly fine
var loader:URLLoader;
var job:Object;
var obArray:Array;
loadXML();
function loadXML():void {
try {
loader=new URLLoader(new URLRequest("http://smthakur.com/php/xml/blog.xml"));
loader.addEventListener(ProgressEvent.PROGRESS, progress);
loader.addEventListener(Event.COMPLETE, complete);
} catch (Er:Error) {
trace("xml Eror" + Er.message);
}
}
function progress(e : ProgressEvent):void {
}
function complete(e : Event):void {
var xml:XML=new XML(e.target.data);
XML.ignoreWhitespace=true;
obArray = new Array();
var list:XMLList=xml.ob;
for (var i : int = 0; i < list.length(); i++) {
job = new Object();
job.title=list*.title;
job.content=list*.content;
obArray.push(job);
}
//i know how to use the for loop .. im just using 0 for demonstration
txtfield.htmlText = obArray[0].title + "
" + obArray[0].content;
}
when the contents are loaded into the txtfield… there are loads of spaces between images and the contents… how can i remove the whitespaces when i have already declared it?