如何捕获成功加载Flash电影时的事件触发器? [英] How to capture an event trigger when a flash movie successfully loaded?

查看:194
本文介绍了如何捕获成功加载Flash电影时的事件触发器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在使用jQuery,以及swfObject动态地将swf电影嵌入到我的网页。



我目前在嵌入immem的音乐播放器进入我的网页,因为他们的嵌入代码没有任何加载屏幕。所以,当我使用swfObject替换元素时,该区域通常是空白的。在最糟糕的情况下,这意味着用户不会知道嵌入的歌曲正在加载。

所以,我试图找出绑定事件后的方式该闪光灯加载。由于我的计划是放置图像与顶部的巨大 z-index ,并使用此触发器来隐藏图像。我想我已经尝试使用 $('#embed')。load(function(){...}); ,没有运气。



有人对此有任何解决方法吗?我只是想知道这是否可能,因为我不想用闪光的黑客攻击,并尝试添加加载器的Flash文件。



还有一点需要注意:为了使它更加清晰,我想将imeem的音乐播放器嵌入到我的网页中。所以,我真的没有任何控制Flash文件,即我不能自己创建一个Flash文件。 解决方案

通常最容易做的事情就是在调用你的处理器之前,等待你的外部资源完成加载。然而,如果你使用swfObject来动态地添加一个嵌入式插件,浏览器将触发你的Flash电影的主体的onload(它不知道任何东西关于你的插件)。



请参阅 http://blog.deconcept.com/swfobject/forum/discussion/271/javascript-onload-event-does-not-反射页面加载使用swfobject / 的类似讨论到你的。这是我最好的猜测,你不能做任何你想要的而不修改原始的瑞士法郎时尚。


I'm currently using jQuery, as well as swfObject to dynamically embed the swf movie into my web page.

I currently having a problem on embeding immem's music player into my web page, as their embed code doesn't have any loading screen. So, when I replace the element using swfObject, that area will generally blank. In worst case, it means that user won't know that the embed song is loading.

So, I'm trying to find out the way to bind an event after that flash got loaded. Since my plan would be placing image with huge z-index on the top and use this trigger to hide the image. I think I've tried to use $('#embed').load(function(){ ... });, with no luck.

Does somebody have any solution for this? I just wonder if that is possible, since I don't want to get hacking with the flash and try to add 'loader' to the flash file.

Some more note: To make it more clear, I want to embed imeem's music player into my webpage. So, I really don't have any control over the flash file, i.e. I can't create a flash file by myself.

解决方案

Typically the easiest thing to do is plain ol' <body onload="..." which would wait for your external resources to finish loading before calling your handler.

However, if you're using swfObject to add an embedded plugin dynamically the browser will fire the onload for the body exclusive of your flash movie (it doesn't know anything about your plugin).

See http://blog.deconcept.com/swfobject/forum/discussion/271/javascript-onload-event-does-not-reflect-page-load-using-swfobject/ for a similar discussion to yours. It's my best guess that you cannot do what you want without modifying the original swf in some fashion.

这篇关于如何捕获成功加载Flash电影时的事件触发器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆