A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: XML.loaded inconsistent

  1. #1
    Junior Member
    Join Date
    Feb 2001
    Posts
    16
    I've found that XML.loaded is inconsistent with its results. It works fine when you're running a movie locally, but I've never gotten it to return TRUE on a .swf file I loaded online.

    Has anyone else had a similar problem?

  2. #2
    Junior Member
    Join Date
    Apr 2001
    Posts
    10
    I had the same problem, and it drove me nuts, until I traced it very thoroughly and realized that it wasn't the xml.loaded, but my code that was supposed to wait for it to do so.
    This is what entually worked for me:

    // frame 1
    gXML = new XML();
    gXML.load("g.xml");
    trace (" about to load g");
    var counter = 0;
    explain = "Glossary data loading, please wait...";

    // frame 2, blank

    // frame 3
    trace("in frame 3");
    if (not gXML.loaded) {
    counter++;
    trace ("g not yet loaded "+ gXML.status);
    if (counter<5000) {gotoAndPlay (2);}
    } else {
    trace ("g data loaded!"+gXML.status);
    }

    // frame 4
    trace("in frame 4");
    if (counter>=5000) {
    explain = "Error: unable to load g.";
    stop();
    } else {
    explain = "G loaded.";
    }


    Try this with a local xml file and you'll see typically only one entry into frame 3. But put it over a slow connection, and frame 3 gets entered several times.

    Hope this helps!

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