A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: xml into flash - basic question

  1. #1
    Junior Member
    Join Date
    Jul 2000
    Posts
    10
    hi all

    I have a xml document:

    <?xml version="1.0"><book><name>ofir</name></book>

    and nothing more in it.
    I load the document into flash, and I try to display the value of the "name" tag which is supposed to be:

    myname = myxml.firstChild.firstChild.firstChild.nodeValue

    and i get an empty value in my text field (deletes the previous value)

    now, I was tol about the ignoreWhite issue, so I installed the lastest plugin .42 and wrote

    myxml = new XML();
    myxml.load("booklist.xml");
    myxml.ignoreWhite = true;

    but the "ignoreWhite" is still in black and not affecting anything.
    when I look in the flash debugger, I see the xml document contents

    what is the problem? why cant I see the content? is it a ignoreWhite issue and if it is, why is it still written in blue (meaning flash won't recognize it as a reserved word)?

    thanks in advance

    ofir


  2. #2
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Code:
    &lt;?xml version="1.0"&gt;&lt;book&gt;&lt;name&gt;ofir&lt;/name&gt;&lt;/book&gt;
    Ok firstly you should really remove the xml version declaration tag as this can be problematic and isnt at this point in time required!So you now have:

    Code:
    &lt;book&gt;&lt;name&gt;ofir&lt;/name&gt;&lt;/book&gt;
    and now you will see that:

    Code:
    myname=myxml.firstChild.firstChild.firstChild.nodeValue
    works fine!



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