# XML DISPLAY ONPRESS (mc prob)

**URL:** <https://forum.kirupa.com/t/xml-display-onpress-mc-prob/172027>\
**Category:** flash\
**Created:** [December 10, 2005, 2:12am UTC](https://forum.kirupa.com/t/xml-display-onpress-mc-prob/172027 "2005-12-10T02:12:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brndn](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@brndn](https://forum.kirupa.com/u/brndn)\
**Post date:** [December 10, 2005, 2:12am UTC](https://forum.kirupa.com/t/xml-display-onpress-mc-prob/172027/1 "2005-12-10T02:12:51Z")

</div>

hi I have been playin around for an hour or so, I know how to load xml data using a button. onPress command.

Not sure how to set the command to a movieclip??

this is what I have tried.

onClipEvent (mouseDown) {  
function loadXML(loaded) {  
if (loaded) {  
\_root.inventor = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;  
\_root.comments = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;  
name\_txt.text = \_root.inventor;  
comment\_txt.text = \_root.comments;  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“inventors2.xml”);  
}
