Hi people , I’m trying to fix something going on with loading some info from an xml file into textfields. I hve this code inside flash to load the xml:
system.useCodepage = true;
var myxml:XML = new XML();
myxml.ignoreWhite = true;
myxml.onLoad = function(success:Boolean) {
if (success) {
firstVideo= myxml.firstChild.childNodes[0].attributes.video;
firstTitle = myxml.firstChild.childNodes[0].attributes.titles;
tbb.text = firstTitle;
trace(firstVideo);
itemCount = myxml.firstChild.childNodes.length;
thumbsURL = myxml.firstChild.attributes.thumbsURL;
videoURL = myxml.firstChild.attributes.videoURL;
my_FLVPlybk.contentPath = videoURL+firstVideo;
my_FLVPlybk.autoSize = false;
my_FLVPlybk.autoPlay = false;
my_FLVPlybk.maintainAspectRatio = true;
for (i=0; i<itemCount; i++) {
item = main.thumbs.attachMovie("item", "item"+i, i, {_x:xpos, _y:ypos});
item.loadContent = myxml.firstChild.childNodes*.attributes.thumb;
item.video = myxml.firstChild.childNodes*.attributes.video;
item.titles.text = myxml.firstChild.childNodes*.attributes.titles;
categoria.text = myxml.firstChild.childNodes*.attributes.categoria;
fecha.text = myxml.firstChild.childNodes*.attributes.fecha;
herramientas.text = myxml.firstChild.childNodes*.attributes.herramientas;
description.text = myxml.firstChild.childNodes*.attributes.description;
var mclListener2:Object = new Object();
mclListener2.onLoadStart = function(target_mc:MovieClip) {
};
...........................and it continues
. But the issue is here: When I load the text data in “titles” it works fine and changes correctly in each “child”. But all the reste, from “categoria” to “description” load the info of the last “child”. I mean, I get different titles but no changes on the other texfields. The titles one is inside a movieclip called item. The others are on the root.
For clarification here is how the xml file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<gallery thumbsURL = "_portfolio/" videoURL = "videos/">
<video thumb="picture.jpg"
video = "a.flv"
titles="Audio"
categoria ="La que sea"
fecha ="Un dia"
herr ="herramietas"
description = "whoever." />
<video thumb="picture2.jpg"
video = "b.flv"
titles="TITLE 2"
categoria="Video"
fecha="One"
herramientas="herramietas"
description = "Whatever." />
<video thumb="c.jpg"
video = "c.flv"
titles="TITLE 3"
categoria="La que sea"
fecha="Two"
herramientas="herramietas"
description = "whichever." />
</gallery>
An the text fields show every time :
categoria=“La que sea”
fecha=“Two”
herramientas=“herramietas”
description = “whichever”
What am I missing?? I guess is something in the fla code, but I can’t work it around!!