# Is it possible to use eval() to build code with variable instead of addres in getUrl?

**URL:** <https://forum.kirupa.com/t/is-it-possible-to-use-eval-to-build-code-with-variable-instead-of-addres-in-geturl/316670>\
**Category:** flash\
**Created:** [November 29, 2010, 12:44pm UTC](https://forum.kirupa.com/t/is-it-possible-to-use-eval-to-build-code-with-variable-instead-of-addres-in-geturl/316670 "2010-11-29T12:44:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinibianko](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@martinibianko](https://forum.kirupa.com/u/martinibianko)\
**Post date:** [November 29, 2010, 12:44pm UTC](https://forum.kirupa.com/t/is-it-possible-to-use-eval-to-build-code-with-variable-instead-of-addres-in-geturl/316670/1 "2010-11-29T12:44:09Z")

</div>

I’ve wrote a code:  
getURL("javascript:openNewWindow(‘[http://www.macromedia.com](http://www.macromedia.com)’,‘thewin’,‘height=400,width=400,toolbar=no,scrollbars=yes’) ");

And I’m trying to replace direct URL link with variable, that contains certain link.

for example:  
url\_txt = urllink[this.id];

I haven’t enough knowledge to build correct code using eval() to gather java code inside action script with variable instead of adress.

for wxample:  
eval(" getURL(“javascript:openNewWindow(” + url\_txt+ ",‘thewin’,‘height=400,width=400,toolbar=no,scrollbars=yes’) ") " );

But it’s not working. I don’t know, is there a syntax error or something else?..

Thank you
