Flash CS4 组合框嵌入时不显示

发布于 2024-08-16 08:32:55 字数 476 浏览 4 评论 0原文

我有一个使用标准 Flash combobox。只要我不使用嵌入 HTML 页面的生成的 SWF,此方法就可以正常工作。当我嵌入它时,组合框不会显示,不会调度鼠标事件,就像它不存在一样。但是,如果我切换到全屏,即使我从全屏切换回来,组合框也会正常显示和运行。

我认为这是组件、Flash CS4 或 Flash 播放器本身的错误,因为它也会发生在只有组合框的空电影上。我在谷歌上搜索时发现的只是有同样问题的人 ,但无解。

任何人都可以建议修复或解决方法吗?

I have a Flash CS4 movie that uses a standard Flash combobox. This works fine, as long as I don't use the resulting SWF embedded on a HTML page. When I do embed it, the combobox doesn't show up, doesn't dispatch mouse events, it's just as if it doesn't exist. However, if I switch to fullscreen, the combobox appears and functions normally, even if I switch back from fullscreen.

I think this is a bug in the component, Flash CS4 or the Flash player itself, since it also happens on an empty movie with just the combobox there. All I've found when I googled is someone with the same problem, but no solution.

Can anyone suggest a fix or workaround?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

江心雾 2024-08-23 08:32:55

我发现设置 wmode 属性 标签到window(之前被设置为transparent)解决了这个问题。为什么这会导致组合框出现问题(而且只是组合框,afaict),我不知道,但我很高兴我解决了这个问题。

编辑:我在代码中找到了解决方法,所以我仍然可以使用透明 wmode。显然,问题在于 Flash 播放器在 wmode 透明模式下不会调度 Event.RENDER 事件。诀窍是在关键时刻手动调度该事件。这是我的解决方案:

private function renderStage(e:Event=null){
 stage.dispatchEvent(new Event(Event.RENDER));
}

myComboBox.addEventListener(ListEvent.ITEM_CLICK, renderStage);
myComboBox.addEventListener(ListEvent.ITEM_DOUBLE_CLICK, renderStage);
myComboBox.addEventListener(ListEvent.ITEM_ROLL_OUT, renderStage);
myComboBox.addEventListener(ListEvent.ITEM_ROLL_OVER, renderStage);
myComboBox.addEventListener(Event.CHANGE, renderStage);

这似乎有效。

I have found that setting the wmode attribute in the <embed> tag to window (it was set to transparent before) solves the problem. Why this causes problems with the combobox (and just the combobox, afaict), I have no idea, but I'm glad I solved this problem.

EDIT: I've found a workaround in code, so I'm still able to use the transparent wmode. Apparently, the problem is that Flash player doesn't dispatch Event.RENDER events when it's in wmode transparent. The trick is to dispatch that event manually, on key moments. This is my solution:

private function renderStage(e:Event=null){
 stage.dispatchEvent(new Event(Event.RENDER));
}

myComboBox.addEventListener(ListEvent.ITEM_CLICK, renderStage);
myComboBox.addEventListener(ListEvent.ITEM_DOUBLE_CLICK, renderStage);
myComboBox.addEventListener(ListEvent.ITEM_ROLL_OUT, renderStage);
myComboBox.addEventListener(ListEvent.ITEM_ROLL_OVER, renderStage);
myComboBox.addEventListener(Event.CHANGE, renderStage);

This appears to work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文