# Need to add JavaScript enabled textbox to XML driven portfolio

**URL:** <https://forum.kirupa.com/t/need-to-add-javascript-enabled-textbox-to-xml-driven-portfolio/154023>\
**Category:** flash\
**Created:** [July 6, 2005, 2:37pm UTC](https://forum.kirupa.com/t/need-to-add-javascript-enabled-textbox-to-xml-driven-portfolio/154023 "2005-07-06T14:37:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanmac79](https://avatars.discourse-cdn.com/v4/letter/r/cab0a1/32.png) [@ryanmac79](https://forum.kirupa.com/u/ryanmac79)\
**Post date:** [July 6, 2005, 2:37pm UTC](https://forum.kirupa.com/t/need-to-add-javascript-enabled-textbox-to-xml-driven-portfolio/154023/1 "2005-07-06T14:37:09Z")

</div>

So that I can get a full size jpg to open in a new, custom browser window.

I’ve gotten this far but it doesn’t seem to want to work. Anybody done this? Thanks all!

[JavaScript for HTML page]

\<script language=“javascript”\>  
function openNewWin( url ){  
window.open(‘url’,‘mywindow’,‘width=400,height=200,toolbar=yes,  
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,  
resizable=yes’)  
};  
\</script\>

url is the string passed to the javascipt function from Flash.

[Actionscript]  
[This is an example of the function that is being called]

function processNews(hypro\_xml)  
{

var d = hypro\_xml.firstChild.childNodes;  
var l = d.length;

output = “”;  
for(var c = 0; c \< l; c++) {  
output += “\<p\>\<a href=“javascript.openNewWin(” + d[c].attributes.url + “)” target=”\_blank"\>" + d[c].firstChild.nodeValue + “\</a\>\</p\>”;  
}

[XML]

\<window url=“[http://www.anylink.com](http://www.anylink.com)”\>Text\</window\>

Everything works if I just try to open the link using HTML and no javascript. That last line looks like this instead:

output += “\<p\>\<a href=”" + d[c].attributes.url + “” target="\_blank"\>" + d[c].firstChild.nodeValue + “\</a\>\</p\>”;
