/    Sign up×
Community /Pin to ProfileBookmark

close window already open and named

I have some Javascript opening a separate flash audio player in a small window, to allow it to play in the bg while the user navigates through the main site.

At the moment the first page is opening and arranging both windows and closing itself (all with Javascript). Then in the main page I have a stop audio function which should close the audio window and a restart audio which should restart it. The window is always addressed as audiowindow.

The weird thing is that the restart link reloads the audio.htm file into the first audiowindow, but the stop audio link doesn’t close the first audiowindow UNLESS it has been restarted via the restart audio link in the main page.

Here’s the link:

[url]http://members.optusnet.com.au/rlambert04/fmm/[/url]

Any help or ideas much appreciated!!

Cheers
Monkeyman

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayApr 20.2006 — Problem is more that the window that opens the "main" and "audiowindow" is immediately closed thereby severing any direct link that could be manipulated. The reload works because you are using the same name as a window currently open. May want to consider opening the "audiowindow" the "main" instead. You could then use the handle to close the audiowindow:

<i>
</i>var audiowindow = window.open("someUrL","audiowindow"........
...
audiowindow.close();
Copy linkTweet thisAlerts:
@Flying_MonkeyauthorApr 22.2006 — Thanks for you reply. I'm a little unclear of what you're suggesting. Do you mean open audiowindow from the mainwindow instead of the first index.htm page? The reason why I was trying to avoid that is that I don't want the audiowindow refreshing (and therefore cutting and restarting the soundtrack music) every time the user goes back to the home page.

Bananaeater
Copy linkTweet thisAlerts:
@felgallApr 22.2006 — When you change the page in the main window you then lose any way of accessing the other window from the main window so the main window can only close the other window if it does so before any page changes. After that the only way to close the other window is from that other window.
×

Success!

Help @Flying_Monkey spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...