本文介绍了IE SCRIPT16389与Flash ExternalInterface回调和JQuery滑块错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站有一个非常奇怪的问题,在我的网站上,我使用JQuery AnythingSlider插件来显示一些视频。每当有人滑到下一个视频,我有一个Flash回调:

$ p $ import flash.external.ExternalInterface;
ExternalInterface.addCallback(movie_pause,player.pause);

和:

  var obj = swfobject.getObjectById($(this).attr('id')); 
if(obj){
obj.movi​​e_pause(); //这是错误发生的地方

$ / code $ / pre

现在奇怪的是,页面首先加载,一切运行良好。然而,刷新后,或只是滑动几次后,IE浏览器开始抛出错误SCRIPT16389:未指定的错误,并指向上述行。但是如果我使用IE进行调试的话,它会指向:

$ p $ c $ function $ _flash_addCallback(instance,name){
instance返回eval(instance.CallFunction(< invoke name = \+ name +\returntype = \javascript\>+ __flash__argumentsToXML(参数,0)+< / invoke>));






$ b我使用swfObject嵌入视频:

pre $ lt; code>< object id =testimonial_ {testimonials_ID}
classid =clsid:D27CDB6E-AE6D-11cf-96B8- 444553540000width =720height =480>
< param name =movievalue =<?php echo content_url();?> videos / player / agflvplayer.swf>
< param name = FlashVars value =id = testimonial_ {testimonials_ID}& flvurl =<?php
echo content_url();?> {testimonials_url}& player_skin =<?php
echo content_url();?> videos / player / SkinOverAllNoCaption.swf& volume = 0>
< param name =wmodevalue =transparent>
<! - [if!IE]> - >
< object type =application / x-shockwave-flashdata =<?php echo content_url();?> videos / player / agflvplayer.swfwidth =720height =480 >
< param name = FlashVars value =id = testimonial_ {testimonials_ID}& flvurl =<?php
echo content_url();?> {testimonials_url}& player_skin =<?php
echo content_url();?> videos / player / SkinOverAllNoCaption.swf& volume = 0>
< param name =wmodevalue =transparent>
<! - <![endif] - >
< p>替代内容< / p>
<! - [if!IE]> - >
< / object>
<! - <![endif] - >
< / object>

你可以看看这个问题http://people.oregonstate.edu/~egliju/ agtools / welcome / test /'> 。
最近的问题,我可以找到是,但没有答案(他们只是推荐使用swfobject,我是)。

似乎我已经找到了解决这个问题的办法。它似乎必须由于Internet Explorer的缓存Flash播放器,由于某种原因,这会导致问题。所以我欺骗它每次重新加载本身,通过改变电影参数url为每个玩家不同。

 <参数名称=movievalue =player / player.swf?no_cache =<?php echo rand();?>> 


I'm having a really odd issue with Internet Explorer, on my website I'm using the JQuery AnythingSlider plugin to display some videos. Whenever someone slides to the next video, I have a flash call back:

import flash.external.ExternalInterface;
ExternalInterface.addCallback("movie_pause",player.pause);

and:

var obj = swfobject.getObjectById($(this).attr('id'));
if(obj){
    obj.movie_pause(); //This is where the error takes place
}

Now the weird thing is, when the page is first loaded, everything runs fine. However after a refresh, or just randomly after sliding a couple of times, IE starts throwing error SCRIPT16389: Unspecified Error and points to the above line. But if I am debugging with IE, it instead points to:

function __flash_addCallback(instance, name) {
    instance[name] = function() {
        return eval(instance.CallFunction("<invoke name=\""+name+"\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) + "</invoke>"));
    }
}

I'm embedding my videos using swfObject:

<object id="testimonial_{testimonials_ID}" 
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="720" height="480">
    <param name="movie" value="<?php echo content_url();?>videos/player/agflvplayer.swf">
    <param name=FlashVars value="id=testimonial_{testimonials_ID}&flvurl=<?php 
    echo content_url();?>{testimonials_url}&player_skin=<?php 
    echo content_url();?>videos/player/SkinOverAllNoCaption.swf&volume=0">
    <param name="wmode" value="transparent">
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="<?php echo content_url();?>videos/player/agflvplayer.swf" width="720" height="480">
        <param name=FlashVars value="id=testimonial_{testimonials_ID}&flvurl=<?php 
        echo content_url();?>{testimonials_url}&player_skin=<?php 
        echo content_url();?>videos/player/SkinOverAllNoCaption.swf&volume=0">
        <param name="wmode" value="transparent">
        <!--<![endif]-->
        <p>Alternative content</p>
        <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
</object>

You can take a look at the issue http://people.oregonstate.edu/~egliju/agtools/welcome/test/'>http://people.oregonstate.edu/~egliju/agtools/welcome/test.Nearest issue I could find is ExternalInterface not working in IE after page refresh but there is no answer(they just recommend using swfobject, which I am).

解决方案

Alright, it seems I've figured out a way around the issue. It seems it has to due with Internet Explorer caching the flash player and for some reason, that causes problems. So I tricked it into reloading itself every time by changing the movie param url to something different for every player.

<param name="movie" value="player/player.swf?no_cache=<?php echo rand();?>">

这篇关于IE SCRIPT16389与Flash ExternalInterface回调和JQuery滑块错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 22:35