# Problem calling js function from FLASH

**URL:** <https://forum.kirupa.com/t/problem-calling-js-function-from-flash/270801>\
**Category:** Uncategorized\
**Created:** [September 14, 2008, 3:12pm UTC](https://forum.kirupa.com/t/problem-calling-js-function-from-flash/270801 "2008-09-14T15:12:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![piroshki](https://avatars.discourse-cdn.com/v4/letter/p/8edcca/32.png) [@piroshki](https://forum.kirupa.com/u/piroshki)\
**Post date:** [September 14, 2008, 3:12pm UTC](https://forum.kirupa.com/t/problem-calling-js-function-from-flash/270801/1 "2008-09-14T15:12:55Z")

</div>

Hi there!  
i am trying to call a js function from flash to open a new window and pass a variable.  
The variable is the button’s instance name and has to get through the new page in order to open the appropriate xml file.

my js code is:

\<script language=“javascript”\>  
function openPopup(name){  
window.open(‘[moreDetails.com](http://moreDetails.com)’,‘moredetails’,width=700);  
alert (name);  
}  
\</script\>

and in flash:

darkSpots.onRelease = function() {  
var product:String = new String;  
product = this.\_name;  
trace(product);  
getURL(“Javascript:openPopup(” + product + “)”);

}

for some reason the javascript is not working at all!!!ANY IDEAS PLEASE???
