A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: "Ghost Nodes" -- Extraneous characters in Flash 6 XML object?

  1. #1
    Member
    Join Date
    Oct 2000
    Posts
    67

    "Ghost Nodes" -- Extraneous characters in Flash 6 XML object?

    I am working on an application which loads XML data into an XML object in the Flash movie.

    I have had no problem parsing it in Flash MX 2004.
    I published it as Flash 6 and it runs perfectly on a machine with Flash Player 7 installed, but breaks completely when run on a machine with Flash Player 6.

    I did some tracing to see what the problem is and found that, for every instance where I would use firstChild to navigate to a node in Player 7, I need to use firstChild.nextSibling to get there in Player 6. Additionally, for each instance of nextSibling I would use for Player 7, I have to use nextSibling.nextSibling to get to the desired node using Player 6.

    This seems to indicate that there are "ghost nodes" present in the XML as read into my object by Player 6.

    Has anyone else experienced this issue, and, if so, how did you solve it or work around it?

    Please help if you can. The deadline looms for cross-platform compatibility.

    Thanks,
    -fredflash

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Well it looks like you are hitting whitespace nodes, try turning off whitespace.

    The other thing is that you would have a much more robust application if instead of relying on absolute paths to your nodes you instead looped through the XML file. This can either be done with for loops or recursive function calls.

    I have a tutorial that shows an example of recursive function calls:

    http://tupps.com/flash/latestnewsv2.html

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  3. #3
    Member
    Join Date
    Oct 2000
    Posts
    67

    Ack! A different problem entirely

    Thank you so much for your help, Luke.

    As it turns out, my problem is much deeper than I first suspected.

    My application loads data from another domain (this is necessary to its purpose) and it uses no scripting of any kind (this is a requirement of its placement). It is to be completely self-contained.

    In order to access the cross-domain data, I have placed a crossdomain.xml domain policy file on my server. I have had no problems loading the xml in the following circumstances:

    running the .swf locally (under player 6 or 7)
    running it embedded in an HTML page located on the same box (6 or 7)
    running the .swf located on a remote server (6 or 7)
    running it embedded in an HTML page located on a remote server (7)

    The only time I'm unable to load the xml data is when running the .swf embedded in an HTML page located on a remote server from a box with player 6 installed.

    This is infuriating to me, as I did much research on the crossdomain policy and would not have taken on the project had I thought it would be unworkable.

    And, it was my belief that the sandbox security was actually made STRICTER in 7 than it had been in 6. How then do I explain to my long-suffering employer that the app will run in 7 but not 6. (the latest statistics I could find show that 7 is only up to 29% market penetration)

    Luke, any help you can give would be greatly appreciated. This project is so off-schedule and over-budget, it could mean Very Bad Things for me.

    Thank you,
    -fredflash

  4. #4
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    I beleive that the sandbox is stricter in 7 than 6 but is a little more flexible. I don't beleive that 6 has the concept of cross domain policy (especially for XML files).

    I don't know how complex your XML file is but I see 2 options:

    1) Use a proxy script so that the XML appears from your local server.

    2) Use DNS so that your server with XML on it appears to be in your sub domain. eg if you give the server the domain name xmlserver.mydomain.com and your flash file comes from www.mydomain.com then you should have no problem find it.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

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