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

[英]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 联系我们: