# Javascript Popup Function in Flash

**URL:** <https://forum.kirupa.com/t/javascript-popup-function-in-flash/101735>\
**Category:** Uncategorized\
**Created:** [February 13, 2004, 5:42am UTC](https://forum.kirupa.com/t/javascript-popup-function-in-flash/101735 "2004-02-13T05:42:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sintax321](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@sintax321](https://forum.kirupa.com/u/sintax321)\
**Post date:** [February 13, 2004, 5:42am UTC](https://forum.kirupa.com/t/javascript-popup-function-in-flash/101735/1 "2004-02-13T05:42:02Z")

</div>

I"m trying to write a fucntion in flash to launch a javascript popup window but can’t seem to get the variables in right. Here is the code.

Button Code  
[AS]on (release) {  
\_root.popup(pic1,436,356);  
}[/AS]

Function in the first frame of the root  
[AS]function popup(number,picwidth,pichieght){  
getURL(“javascript:var mypopup = window.open(‘gallery/’+number+’.htm’,‘mySite’,‘toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=‘picwidth’,height=‘pichieght’,top=’+eval((screen.availHeight - ‘pichieght’) / 3)+’,left=’+eval((screen.availWidth - ‘picwidth’) / 2));mypopup.focus();”);  
}[/AS]

Any ideas?
