hi all, i know how to solve this problem using AS2 but am trying out AS3 as it seems a lot better…
here’s the code i’m using:
var textLoader:URLLoader = new URLLoader();
var textRequest:URLRequest = new URLRequest("list.xml");
textLoader.load(textRequest);
textLoader.addEventListener(Event.COMPLETE,fileLoaded);
var xml:XML;
function fileLoaded(e:Event):void {
xml = new XML(e.target.data);
var il:XMLList = xml.person;
for (var i:uint=0; i<il.length(); i++){
text_field.text = il.text()*+"
";
//trace(il.text()*+"
");
}
text_field.wordWrap = true;
}
ok, it all works fine in the trace output window but in the dynamic text box, it just shows the last XML entry where i need it to show the complete list
so i’m guessing it is just overwriting each entry instead of registering the line break but i can’t figure out why…
the XML code is like this
<list>
<person>lastname1,firstname1 - phonenumber</person>
<person>lastname2,firstname2 - phonenumber</person>
<person>lastname3,firstname3 - phonenumber</person>
</list>
can someone please help me out with this?