dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Strange error in Flash -> XML

  1. #1
    Junior Member
    Join Date
    Oct 2004
    Location
    Planet Earth
    Posts
    81

    Strange error in Flash -> XML

    Hi guys !


    I have a problem with loading a certain node from XML to the output/error
    window in Flash (MX 2004).

    On google , people sat that you have to load the First Child :
    ".firstChild"
    This didn't work but I tried it with .lastChild and it worked !
    When I used the .firstChild , Flash returned " null "

    This is in my opinion very strange , so the final question is :

    Why doesn't Flash load the node when I use ".firstChild" ?
    (My XML has 1 child);


    PS: I posted this already in "Actionscript" , but nobody answered
    http://www.badhobbit.be
    --> Please, give me feedback in the "Member Sites" section here.

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    2 things: Flash returns whitespace as nodes, so you might be seeing the whitespace node.
    It could be some of the header lines which might not parse to valid a valid node that flash understand.

    Personally I never refer to values in a xml document by firstNode, lastNode or ChildNode[2], I always loop through the xml document. The whole point of xml is flexibility and if you are using firstNode or lastNode you are simply limiting your flexibility.

    Thanks

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

  3. #3
    Junior Member
    Join Date
    Oct 2004
    Location
    Planet Earth
    Posts
    81

    confused

    Yeah , I know , but my code is perfect... It displays the value I want , but I just don't understand the logic between Flash and XML when using firstChild

    (Flash returns "null" with firstChild)

    It is hard to explain for me , sorry




    R.Raven , 14 y.


    EDIT : c'mon can someone please tell me the problem ? I searched on google
    , and I found exactly 77 results meaning that there aren't much people knowing...
    Last edited by Eagle123123; 10-11-2005 at 10:19 AM.
    http://www.badhobbit.be
    --> Please, give me feedback in the "Member Sites" section here.

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