rendered paste bodyfunction loadNews() {
// xml objekti
var xml:XML = new XML();
xml.ignoreWhite = true;
// xml:n ladattua tiedon tallennus flash muuttujiin
xml.onLoad = function() {
// ekasta nodesta "rootti"
var news:Array = xml.firstChild.childNodes;
// tyhjät arrayt
newsTitle = [];
newsText = [];
// arrayhin sijoitus
for (var i = 0; i<news.length; i++) {
// xml atribuutista <node title="foo">
newsTitle[i] = texts[i].attributes.title;
// xml nodesta <node> foo </node>
newsText[i] = texts[i].firstChild.firstChild.nodeValue;
}
};
// xml tiedoston lataus
xml.load("news.php");
}