# Reload XML data using Javascript

**URL:** <https://forum.kirupa.com/t/reload-xml-data-using-javascript/276448>\
**Category:** flash\
**Created:** [November 27, 2008, 3:01pm UTC](https://forum.kirupa.com/t/reload-xml-data-using-javascript/276448 "2008-11-27T15:01:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![goomy](https://avatars.discourse-cdn.com/v4/letter/g/8edcca/32.png) [@goomy](https://forum.kirupa.com/u/goomy)\
**Post date:** [November 27, 2008, 3:01pm UTC](https://forum.kirupa.com/t/reload-xml-data-using-javascript/276448/1 "2008-11-27T15:01:20Z")

</div>

Hi All! 😉

I have small flash file calling numbers from xml data. Is there a way to reload XML data using javascript? I mean to click on the button and just XML not whole flash reload?

I’ve seen something with callExternalInterface() but dont really know how to implement that into my code. Here’s code of my AS2:

```auto
function loadXMLData(loaded) 
    {
    if (loaded) {
        _root.hotnumber1 = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
        _root.hotnumber2 = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
        _root.hotnumber3 = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
        
        hotnum1_txt.text = _root.hotnumber1;
        hotnum2_txt.text = _root.hotnumber2;
        hotnum3_txt.text = _root.hotnumber3;
            }
    
    else {
        trace("Could not load XML file");
    }
    } 

xmlFile = new XML();
xmlFile.ignoreWhite = true;
xmlFile.onLoad = loadXMLData;
xmlFile.load("numbers.xml");

```

Can someone help me out with that xml reload in javascript? Thanks in advance.
