---
title: "xml/flash = strul!"
type: "forum-thread"
url: "https://www.webforum.nu/amne/flash/87408-xml-flash-strul"
topic: "Flash"
topic_url: "https://www.webforum.nu/amne/flash"
author: "sub"
published: "2003-10-01T16:00:11.000Z"
updated: "2003-10-01T16:00:11.000Z"
replies: 0
views: 193
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/flash/87408-xml-flash-strul"
---

# xml/flash = strul!

## #1 — sub, 2003-10-01T16:00Z

hej!

hej.
har en mysql databas, datan tracas ut av php/xml.
xml'en läses in i flash, enligt nedan:

my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function() {
output_txt.text = this.firstChild.childNodes.firstChild.nodeValue;
mclist.output_list.text = this.firstChild.childNodes\[0\].attributes.news;
mclist2.output_list2.text = this.firstChild.childNodes\[0\].attributes.text;
};
my_xml.load("skit.php");

mitt problem är att jag inte vill ha ett specifikt nodnummer (0 i det här fallet) utan jag vill att flash tar ALLT som finns i databasen under 'news' och 'text'. hur bör jag bäst göra detta?

jag testade enligt följande, men loopen verkar inte fungera alls, för ingen text överhuvudtaget skrivs ut i flash;

my_xml.onLoad = function() {
attachMovie("template_mc", "template_mc", 999);
for (var i = 0; i\<this.firstChild.childNodes.length; i++) {
var clip = template_mc.duplicateMovieClip("news"+i+"\_mc", i);
clip.output_news.text = this.firstChild.childNodes*.firstChild.nodeValue;
clip.output_txt.text = this.firstChild.childNodes*.attributes.news;
clip.\_y = i\*clip.\_height;
}
template_mc.removeMovieClip();
};
my_xml.load("skit.php");

själva tepmplate_mc ligger i library med linkage till förtsta framen.

all hjälp är tacksam

/f**

Permalänk: https://www.webforum.nu/p/87408

---

Tråden på webben: https://www.webforum.nu/amne/flash/87408-xml-flash-strul
