Click to See Complete Forum and Search --> : Pre-loader for XML data

04-25-2001, 05:21 AM
I've got a flash file that I'm loading some XML data into and displaying in a dynamic text box. There's quite a bit of data and I'd like to put a preloader on to determine when the data has loaded.

At the moment - I've tried a ifFrameLoaded on the second frame that loads the data into the xml and I'm using an onLoad to call the function to process the data.

The problem is that the second frame IS loaded straight away - but the data isn't - is there any way to do a pre-loader that examines when the data is loaded?

Has anyone got any examples of pre-loaders with xml data or any ideas on how I can acheive this?

04-25-2001, 10:59 AM

here is my code that displays my data in level 0

function loadtext () {
// loads in xml
myXml = new XML();
myXml.onLoad = ParseXml;

function ParseXml () {
if (this.loaded && this.hasChildNodes) {
count = 0;
xmltopLine = new Array();
xmlsecondline = new Array();
xmlthirdline = new Array();
menuthirdline = new Array();
xmltopline = this.childNodes;
for (i=0; i<=xmltopline.length; i++) {
if (xmltopline[i].nodeName.toLowerCase() == "newsarticles") {
xmlsecondline = xmltopline[i].childNodes;
for (k=0; k<=xmlsecondline.length; k++) {
if (xmlsecondline[k].nodeName == "newsdetails") {
xmlthirdline = xmlsecondline[k].childNodes;
for (j=0; j<=xmlthirdline.length; j++) {
if (xmlthirdline[j].nodeName == "newsheadline") {
menu_txt += "<font size=\"-1\"><b>\""+menuthirdline+"\"</b></font><br>";
max = menuthirdline.length;
lastRefresh = 0;
refresh = 300;
Data = new XML();
Data.onLoad = ParseXml;
Data.loadtext = loadtext;

but i can't get my variables in level 1,2,3 can anyone help


justice strike
04-25-2001, 11:47 AM
hmm is this the same subject??? well anyway what i would do is get the file size of the xml file and monitor the downstream ofcourse i don't thik it's possible to make a preloader for a xml file but that's just my opinion~!!

04-26-2001, 02:37 AM
I think your answer would be...

Using onLoad...

I would change the visibility of my loading movie clip to false.

Then continue with processing.