dr.swank
10-11-2002, 04:32 PM
well, again i post to show further development:
var R;
var N;
var cont = new Array();
//====================================//
// this parses the xml data
function myLoad() {
//root of xml file
R = this.firstChild;
//root length of xml file
RL = this.firstChild.childNodes.length;
// first node with data i need
N = R.childNodes[3];
//reference to the first block as a counting unit.
U = RL-3;
UU = Math.abs(U-RL);
//xml parser to arrays ncount is main nodes, cont is content
for (m=UU; m<RL; m++) {
ncount = R.childNodes[m];
for (n=0; n<=5; n++) {
cont[n] = ncount.childNodes[n].firstChild.nodeValue;
attachMovie("textBox", ["file"+m+"field"+n], ((m*10)+n));
textC = eval(["file"+m+"field"+n+".textbox"]);
// this sets the y position of the text fields on the screen. the -270 is to set the first field at y=0
textC._y = (m*90)+(n*15)-270;
// this puts the xml node value in the apropriate text field
textC.text = R.childNodes[m].childNodes[n].firstChild.nodeValue;
}
}
}
//-----------------------------------------------//
jsoXML = new XML();
jXML = new XML();
jsoXML.ignoreWhite = true;
jsoXML.onLoad = myLoad;
jsoXML.load("jsoXML.xml");
this now works as such that i can populate fields that are dynamically loaded based on the xml file. i now get a list of all node values in the xml file. btw: the reason for doing this entire crazy sleep robbing adventure is because I created the xml file from a standard export function in filemaker. this could be a good thing being as my client has no clue about it stuff and i want her toi be able to update her homepage without having to worry about proper coding or variable names. i guess this puts me in first grade of Flash and XML. more as events warrent.
the doctor
var R;
var N;
var cont = new Array();
//====================================//
// this parses the xml data
function myLoad() {
//root of xml file
R = this.firstChild;
//root length of xml file
RL = this.firstChild.childNodes.length;
// first node with data i need
N = R.childNodes[3];
//reference to the first block as a counting unit.
U = RL-3;
UU = Math.abs(U-RL);
//xml parser to arrays ncount is main nodes, cont is content
for (m=UU; m<RL; m++) {
ncount = R.childNodes[m];
for (n=0; n<=5; n++) {
cont[n] = ncount.childNodes[n].firstChild.nodeValue;
attachMovie("textBox", ["file"+m+"field"+n], ((m*10)+n));
textC = eval(["file"+m+"field"+n+".textbox"]);
// this sets the y position of the text fields on the screen. the -270 is to set the first field at y=0
textC._y = (m*90)+(n*15)-270;
// this puts the xml node value in the apropriate text field
textC.text = R.childNodes[m].childNodes[n].firstChild.nodeValue;
}
}
}
//-----------------------------------------------//
jsoXML = new XML();
jXML = new XML();
jsoXML.ignoreWhite = true;
jsoXML.onLoad = myLoad;
jsoXML.load("jsoXML.xml");
this now works as such that i can populate fields that are dynamically loaded based on the xml file. i now get a list of all node values in the xml file. btw: the reason for doing this entire crazy sleep robbing adventure is because I created the xml file from a standard export function in filemaker. this could be a good thing being as my client has no clue about it stuff and i want her toi be able to update her homepage without having to worry about proper coding or variable names. i guess this puts me in first grade of Flash and XML. more as events warrent.
the doctor