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 6820503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:25:57+00:00 2026-05-26T21:25:57+00:00

Hello I keep running into errors and outputs that say undefined in my output

  • 0

Hello I keep running into errors and outputs that say “undefined” in my output panel when I try and parse XML using AS3. I would like to get the values of score1, score2….
Can anyone tell me what I am doing wrong?

thanks

Scientific

    ////AS3//////////

    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;

    var myXML:XML;
    var xmlLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    xmlLoader.load(new URLRequest("scores.xml"));

    function xmlLoaded(e:Event):void
    {
         myXML = new XML(e.target.data);
         trace(myXML.scores1); 

    }
    //////xml file////////////
    <?xml version="1.0" encoding="UTF-8"?>
    <feed xmlns="http://www.w3.org/2005/Atom">
    <root>
    <scores>
      <id>1</id>
       <score1>105</score1>
       <score2>60</score2>
       <score3>56</score3>
       <score4>48</score4>
       <score5>30</score5>
    </scores>
    </root>
    </feed>
  • 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-05-26T21:25:57+00:00Added an answer on May 26, 2026 at 9:25 pm

    You might find the descendant accessor .. useful. Example:

    myXML..score1[0].toString()
    

    Edit:

    There is something about using the generic namespace that is causing some problems. Adding an alias fixes it, eg:

    <feed xmlns:atom="http://www.w3.org/2005/Atom">
    

    Otherwise Flash is expecting that you are going to use fully qualified names to specify the element you are trying to access:

    var qName:QName = new QName("http://www.w3.org/2005/Atom","score1");
    trace(myXML.descendants(qName)[0].toString()); // 105
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to style a menu, but I keep running into this weird margin
Using jQuery, how do I remove the #hello div below and just keep the
Hello I have an Activity that shows a CountDown in a textView (using CountDownTimer),
Hello I'm trying to insert some XML data into a table on SQL Server
Hello I am working with a simulator that uses rcS scripts to boot, this
Let's say I have this Hello.scala. object HelloWorld { def main(args: Array[String]) { println(Hello,
#hello , i wounder why my code keep stoping at the secound while loop
I'm trying to compile a simple Hello World program in C++ but I keep
I been trying to get the Spring Batch Hello World 3 example running from
Hello I'm using the fullcalendar jQuery plugin to create a calendar app. When I

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.