webForumDet fria alternativet

xml/flash = strul!

0 svar · 170 visningar · startad av sub

subMedlem sedan juli 200215 inlägg
#1

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**

126 ms totalt · 3 externa anrop · v20260731065814-full.0e50b1ef
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
124 ms — hämta tråd, inlägg och bilagor (db)