# Why will it not work?

**URL:** https://forum.kirupa.com/t/why-will-it-not-work/155362
**Category:** flash
**Created:** [July 16, 2005, 10:09pm UTC](https://forum.kirupa.com/t/why-will-it-not-work/155362 "2005-07-16T22:09:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mh22gw](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@mh22gw](https://forum.kirupa.com/u/mh22gw)
#### Post date: [July 16, 2005, 10:09pm UTC](https://forum.kirupa.com/t/why-will-it-not-work/155362/1 "2005-07-16T22:09:43Z")

</div>

this code should work, shouldn’t it?

```auto
 myTreeListener = new Object();
myTreeListener.change = function(evtObject:Object) {
 var selectLabel:String = evtObject.target.selectedItem.attributes.label;
 var selectData:String = evtObject.target.selectedItem.attributes.data;
 txtMess.text = "<a href='"+selectData+"'>"+ selectLabel +"</a>";
 this.getURL('"+ selectData +"');
}  
xmlTree.addEventListener("change", myTreeListener); 

```

It will not open the URL.
