IE SCRIPT16389 Flash外部接口回调和JQuery滑块出错

时间:2011-07-14 19:01:46

标签: php javascript flash internet-explorer

我在Internet Explorer上遇到了一个非常奇怪的问题,在我的网站上我使用JQuery AnythingSlider插件来显示一些视频。每当有人滑到下一个视频时,我都会回拨一下:

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

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

现在奇怪的是,当首次加载页面时,一切运行正常。但是在刷新之后,或者只是在滑动几次后随机,IE开始抛出错误SCRIPT16389:未指定的错误并指向上面的行。但是,如果我使用IE进行调试,则会指向:

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

我正在使用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>

你可以看一下http://people.oregonstate.edu/~egliju/agtools/welcome/test/'>http://people.oregonstate.edu/~egliju/agtools/welcome/test这个问题。 我能找到的最近的问题是ExternalInterface not working in IE after page refresh,但没有答案(他们只是建议使用swfobject,我就是这样)。

1 个答案:

答案 0 :(得分:3)

好吧,似乎我已经想出了解决这个问题的方法。似乎它必须通过Internet Explorer缓存Flash播放器,并且由于某种原因,这会导致问题。因此,我每次都通过将电影参数URL更改为每个玩家的不同内容来欺骗它自己重新加载。

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