父窗口刷新后如何聚焦子窗口

[英]How to focus child window after parent window refresh


I am opening a popup window containing a flash movie using JavaScript. The popup contains a media player that uses SoundManager2. Users add files to the media player from the parent window. However, when reloading the parent window, the reference to the child window (media player) is lost. So, to bring focus to the media player, we currently have to call window.open, which reloads the url, thus interrupting the playing media.

我正在使用JavaScript打開一個包含flash電影的彈出窗口。彈出窗口包含一個使用SoundManager2的媒體播放器。用戶從父窗口向媒體播放器添加文件。但是,重新加載父窗口時,對子窗口(媒體播放器)的引用將丟失。因此,為了將焦點帶到媒體播放器,我們當前必須調用window.open,它會重新加載url,從而中斷播放媒體。

Does anyone know of a way to focus the media player window without reloading its contents? I'm pretty sure Javascript is out. Is there a way to do this with ActionScript?

有沒有人知道如何在不重新加載其內容的情況下關注媒體播放器窗口?我很確定Javascript已經出局了。有沒有辦法用ActionScript做到這一點?

1 个解决方案

#1


You could call a javascript function from Flash that gives that window focus, however, I'm not sure if there is a decent way of doing this that wouldn't potentially annoy a user, unless you can do it only when new media is added to the player.

你可以從Flash中調用一個javascript函數來提供窗口焦點,但是,我不確定是否有一種不太好的方法來做到這一點不會對用戶產生負面影響,除非你只能在添加新媒體時才這樣做給玩家。

In any case, ExternalInterface or getURL/navigateToURL will allow you to call a javascript function from Flash.

無論如何,ExternalInterface或getURL / navigateToURL將允許您從Flash調用javascript函數。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2009/07/01/300ee3533f0d2de25d6d7596c9ab4e61.html



 
  © 2014-2022 ITdaan.com 联系我们: