# XML -\> flash

**URL:** <https://forum.kirupa.com/t/xml-flash/184940>\
**Category:** programming\
**Created:** [April 9, 2006, 1:41pm UTC](https://forum.kirupa.com/t/xml-flash/184940 "2006-04-09T13:41:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chulimanga](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@chulimanga](https://forum.kirupa.com/u/chulimanga)\
**Post date:** [April 9, 2006, 1:41pm UTC](https://forum.kirupa.com/t/xml-flash/184940/1 "2006-04-09T13:41:32Z")

</div>

Hi,  
is any anybody who could help me?  
I’m solving this problem:  
I got flash game recieving informations from XML file. Action script for my game is already written and I should probably use it. It contains:

```auto

players.load("data.xml");
players.onLoad = convertXMLPlayers;

function convertXMLPlayers()
{
    trace (this);
    mainTag = new XML();
    elementTag = new XML();
    playersList = new Array();
    propertiesList = new Array();
    playersArray = [];
    mainTag = this.firstChild.nextSibling;
    if (mainTag.nodeName.toLowerCase() == "players_root_tag")
    {
        playersList = mainTag.childNodes;
        for (i = 0; i < playersList.length; i++)
        {
            if (playersList*.nodeName.toLowerCase() == "player")
            {
                propertiesList = playersList*.childNodes;
                var name = "";
                var mail = "";
                var day = "";
                var hits = "";
                for (j = 0; propertiesList.length >= j; j++)
                {
                    elementTag = propertiesList[j];
                    elementType = elementTag.nodeName.toLowerCase();
                    if (elementType == "name")
                    {
                        name = elementTag.firstChild.nodeValue;
                        continue;
                    } // end if
                    if (elementType == "mail")
                    {
                        mail = elementTag.firstChild.nodeValue;
                        continue;
                    } // end if
                    if (elementType == "day")
                    {
                        day = elementTag.firstChild.nodeValue;
                        continue;
                    } // end if
                    if (elementType == "hits")
                    {
                        hits = elementTag.firstChild.nodeValue;
                    } // end if
                } // end of for
                playersArray[playersArray.length] = [name, mail, day, hits];
            } // end if
        } // end of for
    } // end if
    trace ("* " + playersArray);
    createTopList();
} // End of the function

```

Only what I need is to prepare the right xml source. My XML file looks like this and there’s some problem I’m not able to find:

```auto

<players_root_tag>
    <player>
      <name>Mr.Chunk</name>
      <mail>chunk@chunk.ch</mail>
      <day>05.00</day>
      <hits>456</hits>
    </player>
</players_root_tag>

```

I tried a lot, but flash file is still not loading content of this XML.

Could you help me, please?

chulimanga - chulimanga(at)[yahoo.com](http://yahoo.com)
