Create a link from xml

I’m trying to create a link in a html enabled textfield, using an xml file.

However somehow this doesn’t work:


main["item"+i].title.html = true;
trace(my_XML.firstChild.childNodes*.attributes.action);  // traces the attribute containing the url correctly
main["item"+i].title.htmlText = "<a href=\"" + my_XML.firstChild.childNodes*.attributes.action + "\" target=\"_blank\">";
main["item"+i].title.htmlText += my_XML.firstChild.childNodes*.attributes.title;
main["item"+i].title.htmlText += "</a>";
main["item"+i].title.setTextFormat(titleFormat);

When I debug, I see the ending < /a> tag showing up but not the begintag and the contents of action attribute.

I tested the following and this actually does work:


myURL = "http://www.kirupa.com";
this.createTextField("myField", 1, 0, 0, 100, 20);
myField.html = true;
myField.htmlText = "<a href=\"" + myURL + "\" target=\"_blank\">" + myURL;
myField.htmlText += "</a>";

How come??