# Loading XML after onClipEvent

**URL:** <https://forum.kirupa.com/t/loading-xml-after-onclipevent/305663>\
**Category:** flash\
**Created:** [March 1, 2010, 4:34pm UTC](https://forum.kirupa.com/t/loading-xml-after-onclipevent/305663 "2010-03-01T16:34:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bertusdeleeuw](https://avatars.discourse-cdn.com/v4/letter/b/e0b2c6/32.png) [@bertusdeleeuw](https://forum.kirupa.com/u/bertusdeleeuw)\
**Post date:** [March 1, 2010, 4:34pm UTC](https://forum.kirupa.com/t/loading-xml-after-onclipevent/305663/1 "2010-03-01T16:34:42Z")

</div>

Hi there,

I’m trying to load XML data after an hitTest but doesn’t work the way I’m programming. Here is the source code:[INDENT][COLOR=Gray]onClipEvent (enterFrame) {

```
if (_root.ster1_mc.hitTest(_root.rocket)) {
    trace("raak");
    
        function loadXML(loaded) {
            
                _root.Teksten = this.firstChild.childNodes[0].childNodes[0];
                _root.tekst_vlak.text = _root.Teksten;
                
        }
        xmlData = new XML();
        xmlData.ignoreWhite = true;
        xmlData.onLoad = loadXML;
        xmlData.load("http://localhost:8888/test.php");

    
} else {
    _root.ster1_mc.gotoAndStop(1);
    _root.myHeader = "";
    _root.myText = "";
    _root.logo._alpha = 100;    
    _root.tekst = "Drag me to the stars to find out more";
}

```

}  
[/COLOR][/INDENT]When I use the XML code simple on a button it works perfect but after my hitTest it’s doing nothing… :x  
When I remove the function it say’s undivined in the textarea.

Can someone please help me out :thumb: ?

Thanks !  
Bertus.
