# Problems with javascript

**URL:** <https://forum.kirupa.com/t/problems-with-javascript/182491>\
**Category:** Uncategorized\
**Created:** [March 18, 2006, 8:30pm UTC](https://forum.kirupa.com/t/problems-with-javascript/182491 "2006-03-18T20:30:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravic](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@ravic](https://forum.kirupa.com/u/ravic)\
**Post date:** [March 18, 2006, 8:30pm UTC](https://forum.kirupa.com/t/problems-with-javascript/182491/1 "2006-03-18T20:30:05Z")

</div>

Hi,  
I am trying to launch a small popup window in flash with javascript functions. Here’s the code i’m using.

```auto

import flash.external.*;

goTo = function() {
    getURL('javascript:window.open("popup.html","","height=200,width=200,left=0,top=0")');
    trace("working");
    ExternalInterface.call("newPost");
}

```

originally i had the window.open function inside another function, and this function also had an alert window that would pop up, so i knew it was called. However whenever goTo was activated, it did not call the function because the alert box never popped up. So i replaced the function with this window.open function. It works fine when testing it in Flash and when i have the .swf movie loaded by itself into the browser, however whenever it is embedded into a page, the window does not pop up.

anyone know why this could be happening? If it would be helpful, i can attach the swf and fla files along with the page it is embedded in.

thanks in advance,  
ravi
