dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Pre-loader for XML data

  1. #1
    Junior Member
    Join Date
    Apr 2001
    Posts
    1
    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?

  2. #2
    Junior Member
    Join Date
    Oct 2000
    Posts
    8

    XML in to level 1

    hi

    here is my code that displays my data in level 0

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

    }
    //
    // PARSING XML
    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") {
    menuthirdline.push(xmlthirdline[j].firstChild.nodeValue);
    }
    }
    }
    }
    }
    }
    menu_txt += "<font size=\"-1\"><b>\""+menuthirdline+"\"</b></font><br>";
    }
    }
    max = menuthirdline.length;
    _root.nextFrame();
    lastRefresh = 0;
    refresh = 300;
    Data = new XML();
    Data.onLoad = ParseXml;
    Data.loadtext = loadtext;
    Data.loadtext();


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

    ta

  3. #3
    FK's Official A&A Addict
    Join Date
    Apr 2001
    Location
    Where am i?
    Posts
    1,592
    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~!!

  4. #4
    Junior Member
    Join Date
    Apr 2000
    Posts
    16
    I think your answer would be...

    Using onLoad...

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

    Then continue with processing.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center