PDA

View Full Version : xml, levels, and attachMovie


grenadier_teg
10-06-2007, 12:11 PM
Ok I've got this on a AS keyframe, with a MC in the library with the linkage "table".
I've also got a instance of the same MC on the stage with the instance name "table".
The one on the stage shows the info from the xml file in dynamic text boxes, but the ones loaded from the library don't show any info.
I'm guessing it's to do with levels and them overwriting each other but I can't figure it out,

Would appreciate the help
Terrence Rose (NZ)


xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = function() {
nodes = this.firstChild.childNodes;
numOfNodes = nodes.length;
for (i=0; i<numOfNodes; i++) {
_root.table.et.text = nodes[i].firstChild.firstChild;
_root.table.mph.text = nodes[i].firstChild.nextSibling.firstChild;
_root.table.reaction.text = nodes[i].firstChild.nextSibling.nextSibling.firstChild;
}
attachResults = function () {
attach = attachMovie("table", "table", r);
attach._x = 0;
attach._y = table._height*r;
};
for (r=0; r<numOfNodes; r++) {
attachResults();
}
};

date = '04-10-07';
xml.load('results'+date+'.xml');
dateTitle.text = date

grenadier_teg
10-10-2007, 04:32 AM
there ya go
thanks :p

atomic
10-10-2007, 04:58 AM
Fla needs to be in a Flash 8 format, not a CS3 one.

grenadier_teg
10-10-2007, 05:10 AM
Thanks for the reply but that doesn't seem to change anything

atomic
10-10-2007, 05:19 AM
I meant that I can't open a CS3 format .fla, as you attached.

It needs to be Saved as in a Flash 8 format and re-attached! :rolleyes:

grenadier_teg
10-10-2007, 05:25 AM
oops :p

grenadier_teg
10-10-2007, 10:36 AM
I don't get it, two Mc's get placed on the stage with the instance name "table". my onLoad function tells the dynamic text boxes, which are on the stage, inside table, to get their info from the xml file.
The "table" mcs that get attached don't overwrite each other, but they do both have the instance name "table". Shouldn't the values inside the text boxes be identical in each instance of the MC?

Confused :confused:

grenadier_teg
10-10-2007, 10:46 AM
I tried trace(targetPath(table)); with no luck, so I'm guessing when the MC's get attached to the stage they are not getting the instance name "table" :confused:

grenadier_teg
10-10-2007, 11:36 AM
Thanks for the support guys, I figured out that the AS had no idea where these dynamic text boxes were, so I changed round my file (not really what I wanted to do) So that it worked, now I have to work on an array to load each node into different movieClips :confused:

atomic
10-10-2007, 02:32 PM
So this is solved?

grenadier_teg
10-11-2007, 04:30 AM
Not the way I wanted to do it, but it works, so I'm happy, I've opened up a new thread asking about the array problem here: http://www.actionscript.org/forums/showthread.php3?p=661513#post661513