Forum Moderators: open
My problem:
If the user goes via the Flash movie and opens a content page then they can get to any of the other content pages via a side menu. This is fine, and if they hit my Back button they can get back to the previous content pages. However, when they get to the page Flash first opened then I want the content window to close (on the next click of the Back button). I also need to account for anchors in the original page which doesn't seem to update the location object that is accessible by javascript.
The code I'm currently using works great in Windows Internet Explorer but in Mac Internet Explorer my Back button can go back through the History stack but doesn't close the window. Safari doesn't even go back through the History stack! I know javascript is working in the popup content window because I have image rollovers which work but my Back function isn't getting called in Safari.
function Back() {
alert("window.opener='" +window.opener +"'");
window.history.back(); if(isWin) {
//this works great on Windows!
if(window.opener!= null && window.opener.name == "flashpg" && window.opener.entryNum <= 0) {
window.close();
}
else {
if(window.opener!= null && window.opener.name == "chilloutRoom") {
window.opener.entryNum = window.opener.entryNum-1;
}
}
}
else {
//Mac code
if(window.opener!= null) {
if(window.opener.name == "flashpg" && window.opener.entryNum <= 0) {
window.close();
}
else {
if(window.opener.name == "flashpg") {
window.opener.entryNum = window.opener.entryNum-1;
}
}
}
}
}
Can you update a variable in the opener window in Safari and Mac Internet Explorer?
Any ideas why the Back button may not be calling the my function?
It should be noted that when the content pages are opened directly from the splash page (that is not via the Flash movie) then my Back buttons work fine and call the function. The exact same file is being used in both instances.