ExternalInterface.call not closing window

I need to have button that closes the window. The window is a .php page, but it has the following javascript function:

function closeWindow(){    
self.close();
}

The AS I have is:

ExternalInterface.call("closeWindow");

When clicked the window does not close.

The odd thing I have another button that scrolls to the top of the page using the following code:

//JS
function scrollTop(){
    window.scroll(0,0);
}
//AS
ExternalInterface.call("scrollTop");

This works fine.

Is there something about closing a window that does not work in AS? Or maybe is there a problem because it is a PHP file? Thanks in advance for your help.