PDA

View Full Version : HELP for small XML fla


mipmip
07-17-2003, 05:36 PM
Can someone take a look at my fla.
I can't display the information from the XML into the swf.
I've made a dynamic txt field where i want to display the data but it doesn't seems to work the way i want it to.


TIA

freddycodes
07-17-2003, 07:00 PM
You only have on text field and the name serie.name is not vlaid for a text field. Which node do you want to appear in the text field? Or do you want to duplicate the nav clip for each item in the xml file?

freddycodes
07-17-2003, 07:09 PM
Still not quite sure what you are up to, but to duplicate the nav clip for each item in the xml file


var dbXML = new XML();
dbXML.ignoreWhite = true;
dbXML.onLoad = function ()
{
var sY = _root.nav._y + _root.nav._height;
var ndRoot = this.firstChild.childNodes;
var i = 0;
for(var i=0;i<ndRoot.length;i++)
{
if(i == 0) {
_root.nav.serie.serie_text.text = ndRoot[i].attributes.name;
}
else {
_root.nav.duplicateMovieClip("nav"+i, i);
_root["nav"+i]._y = sY;
sY += _root["nav"+i]._height;
_root["nav"+i].serie.serie_text.text = ndRoot[i].attributes.name;
}
}
}
dbXML.load("menus.xml");
stop();


Make sure to change the text field instance name to serie_text instead of serie.name

mipmip
07-18-2003, 01:02 PM
Hmm .. Thx
Is is a great help for me.
Now it is working the way i want it to.
Thx for your quick reply.

I'm trying to make a picture gallery that gets the information from a xml.

I will try now to create the buttons and an container that loads the image.

mipmip
07-18-2003, 05:07 PM
Can anyone tell me what to fill in as variable into the dynamic texfield in order to display the right text from the XML.

TIA