Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8390537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:01:05+00:00 2026-06-09T19:01:05+00:00

I created an XML file named stage1.txt in the folder musics. The XML File

  • 0

I created an XML file named “stage1.txt” in the folder “musics”.
The XML File is :

<music>
    <speed>10</speed>
    <time>
        <note>1</note>
        <note>12</note>
        <note>32</note>
        <note>41</note>
    </time>
    <where>
        <lane>3</lane>
        <lane>2</lane>
        <lane>1</lane>
        <lane>4</lane>
    </where>
</music>

And then in the flash file I used the following code to recall the XML file :

and then in the flash file I used the following code to get the data.

var myXML:XML = new XML();
myXML.ignoreWhite=true;
myXML.load("musics/stage"+_global.stages+".xml");
var temp = 0, temp2 = 0;
myXML.onLoad = function(success){
if (success){
trace (myXML);
}
}

It worked fine until here. However, I wanted to recall the first value of the XML file, the “speed”.
I tried using this code :

var speed = myXML.firstChild.firstChild.nodeValue;

but it doesn’t seem to work.
Tried other things like :

myXML.firstChild.childNodes[0].nodeValue

but doesn’t work too.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:01:06+00:00Added an answer on June 9, 2026 at 7:01 pm

    Add an extra firstChild in there. I’m not really sure why, but it seems the parser handles the document as a whole as being a seperate level.

    The best way to find the stuff you need when things aren’t working out is to trace and see what it contains. So start with the xml object (‘trace(myXML)’) and traverse from there on ‘trace(myXML.firstChild)’ -> ‘trace(myXML.firstChild.firstChild)’ -> etc. until you find the info you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML document as follows: <directory> <file><monitored>0</monitored> <xferStatus>1</xferStatus> <name>test1.txt</name> <size>7</size> <created>03/31/10 11:30:02
I've created a new .xml file in my layout folder called log.xml . It
I want to write an XML file. I have created an XSD file named
I created a file in \res\layout named contactlist.xml But it is not recognized in
I have created XML file,but I can't view it/output it.I know there is no
I have created an xml file like this: <?xml version=1.0 encoding=utf-8?> <ListView xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent
I created the button in the main.xml file and initialized it in the activity
I created a method to unmarshall my xml (item.xml) file .But if there are
say there is an xml file, which not created by me, with a known
I've created a simple Flex application to fetch an XML file. I need a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.