Skip to main content
Participant
January 18, 2007
Question

xml = nothing happens

  • January 18, 2007
  • 4 replies
  • 656 views
This won't work, neither inside onConnect nor outside.

xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = function(success){
trace("success: "+success);
trace("xml: "+xml);
}
xml.load("tjallabais.xml");

Anyone?
    This topic has been closed for replies.

    4 replies

    Participating Frequently
    January 26, 2007
    hi,

    if you try to load xml file from a local location on your fms xml.onLoad doesn't work. But you can use file object.

    xml.load(new File("tjallabais.xml"));

    January 26, 2007
    Not sure what you're trying to do, but you might want to visit gotoandlearn.com and watch the free tutorials on loading xml. I've used the same code successfully for rtmp connections.
    Weell___Author
    Participant
    January 19, 2007
    Nope, still nothing:(
    Paul Nevins found a workaround, you have to use File.readAll() to read the xml file. The fileObject returns an array with all the nodes, just loop through it, adding each element to a string. This string is the key to your new and shiny xml object:) Easy? Never!

    http://livedocs.macromedia.com/fms/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000818.html
    Inspiring
    January 18, 2007
    I have not tested this at all, but I think you have to put the xml file into a folder inside your application directory.

    [application_folder]/http/[application_instance_name]/yourfile.xml