A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Problem with xml on server

  1. #1
    Special Member raufaamir's Avatar
    Join Date
    Sep 2001
    Location
    Satellite Town, Pluto, Universe
    Posts
    201

    Unhappy Problem with xml on server

    HI, I have contents in a site coming from xml. This site works fine on local machine but when I upload it on server and check that same site from server it show "undefined" on the text fields. When i refresh browser window then it show contents. The xml file size is 7kb only.

    Can you tell me why this problem is coming and how to solve this.

    Thanks

    [Illustration][Commercial Designing]
    [Textile Designing][Large Format Printing] [Web Designing]

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    what actionscript are you using to populate the textfields ?
    you need to be using the XML.onLoad function (AS2) to ensure loading has completed.

  3. #3
    Special Member raufaamir's Avatar
    Join Date
    Sep 2001
    Location
    Satellite Town, Pluto, Universe
    Posts
    201
    Sorry for late reply here is the code which i am using:

    PHP Code:
    function loadXML(loaded) {
        if (
    loaded) {
            
                    
            
    //----page one ------
            
    _root.page1head1 =         this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
            
    _root.page1para1 =         this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
            
    _root.page1head2 =         this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
            
            
            
            
    //----page two ------
            
    _root.page2head1 =         this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
            
    _root.page2para1 =         this.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue;
            
    _root.page2para2 =         this.firstChild.childNodes[1].childNodes[2].firstChild.nodeValue;
            
            
            
    //----page three ------
            
    _root.page3head1 =         this.firstChild.childNodes[2].childNodes[0].firstChild.nodeValue;
            
    _root.page3para1 =         this.firstChild.childNodes[2].childNodes[1].firstChild.nodeValue;
            

            
        } else {
            
    content "file not loaded!";
        }
    }
    xmlData = new XML();
    xmlData.ignoreWhite true;
    xmlData.onLoad loadXML;
    xmlData.load("data.xml"); 
    Please let me know if this code is ok

    Thanks

    [Illustration][Commercial Designing]
    [Textile Designing][Large Format Printing] [Web Designing]

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    I cannot see any problem with your code,

    in a test file, can you add a stop action to the frame where the xml loads
    and advance the timeline within the onLoad function. this test should check
    that all xml loading and parsing is completed.

  5. #5
    Special Member raufaamir's Avatar
    Join Date
    Sep 2001
    Location
    Satellite Town, Pluto, Universe
    Posts
    201
    Thanks, your idea was right. I have add stop action where xml loads.Then I have used set Interval to stop playhead for a while then move ahead. It works!

    Now i have one different question. I want to load each time refresh xml not from cache because contents are changing from admin site.

    How can i do this?

    Thanks

    [Illustration][Commercial Designing]
    [Textile Designing][Large Format Printing] [Web Designing]

  6. #6
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    add a timestamp to force fresh data from the server -

    xmlData.load("data.xml?vers="+new Date().getTime());

  7. #7
    Special Member raufaamir's Avatar
    Join Date
    Sep 2001
    Location
    Satellite Town, Pluto, Universe
    Posts
    201
    I used this:

    xml.load(”file_name.xml?” + random(9999));

    it also works!

    Thanks for your help

    [Illustration][Commercial Designing]
    [Textile Designing][Large Format Printing] [Web Designing]

  8. #8
    Member
    Join Date
    Apr 2009
    Posts
    41

    XML parsing takes too much long time

    Hi...
    I have a XML having 174 nodes overall.
    Some node has value while some may/maynot have value.
    When I parse it for a game play, it takes too much long time to get parse causing preloader to run for approx 1-2min.
    Rest afterward it goes all OK.
    Any help to reduce the parsing time so that it can be parse fastly for a quick game play.
    I need it to be done earliest.

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