编程语言
首页 > 编程语言> > php-带有Flash ExternalInterface回调和jQuery滑块的IE SCRIPT16389错误

php-带有Flash ExternalInterface回调和jQuery滑块的IE SCRIPT16389错误

作者:互联网

我在使用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/’\u0026gt;http://people.oregonstate.edu/~egliju/agtools/welcome/test.
我能找到的最近的问题是ExternalInterface not working in IE after page refresh,但没有答案(他们只是建议使用swfobject,我是).

解决方法:

好吧,看来我已经找到解决此问题的方法.似乎必须归因于Internet Explorer缓存Flash Player,并且由于某种原因而导致问题.因此,我通过将电影参数网址更改为每个播放器不同的方式来欺骗它每次重新加载自身.

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

标签:flash,internet-explorer,javascript,php
来源: https://codeday.me/bug/20191208/2089432.html