如何检测Flash电影已使用javascript/jquery播放完毕,然后运行功能 [英] How to detect a flash movie has finished playing with javascript / jquery and then run a function
问题描述
我需要创建一个启动页面类型的东西.它需要播放Flash电影,然后在完成电影播放后使用html/js显示全屏图像.电影将闪烁,并且图像显示将由javascript驱动.
I need to create a splash page type thing. It needs to play a flash movie and then when that movie has finished show a full screen image using html/js. THe movie will be flash and the image display will be javascript powered.
我不知道如何在一页上执行此操作.任何帮助都将是惊人的.
I have no idea how to do this on one page. Any help would be amazing.
感谢您的阅读.
推荐答案
您将要使用
取决于Flash电影的构造方式,当动画到达最后一帧时,运行ExternalInterface.call("myfunction");.将在javascript中调用一个名为"myfunction"的函数.示例: Depending on how your flash movie is constructed, when the animation reaches the last frame, running ExternalInterface.call("myfunction"); will call a function in javascript called "myfunction". Example: 我真的不能说如何将其放入电影中,因为我不知道您的电影是使用动作脚本动画还是时间轴动画构造的,还是您想播放Flash视频. (如果您使用的是视频,则可以为Event.COMPLETE附加一个事件侦听器,然后在其中进行所有操作).如果是动作脚本动画,则需要查找补间的结尾或其他内容.
为了安全起见,将其包装在try/catch中.您需要确保在嵌入swf时具有allowScriptAccess = always或sameDomain. 参考此处 I can't really say how to put it into your movie, because I don't know if your movie is constructed using actionscript animation, or timeline animation, or you're wanting to play a flash video. (If you are using a video, you can attach an event listener for Event.COMPLETE and do your c all there). If its an actionscript animation, you'll need to find the end of a tween or something.
Wrapping it in a try/catch is just to be safe. You'll need to make sure when you embed the swf, you have allowScriptAccess=always or sameDomain. Reference here 这篇关于如何检测Flash电影已使用javascript/jquery播放完毕,然后运行功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!<script type="text/javascript">
function myfunction()
{
alert("hello!"); // replace with some jquery
}
</script>