【问题标题】:Actionscript onMouseOut listener not totally working under Internet Explorer 8Actionscript onMouseOut 侦听器在 Internet Explorer 8 下不完全工作
【发布时间】:2011-03-22 15:40:19
【问题描述】:

我正在使用 Flash CS4 制作视频播放器。我正在尝试构建播放器,以便当用户将鼠标移到 flash 对象上时,播放控件会出现,而当用户将鼠标移出 flash 对象时,控件会消失。

我设法将一些代码放在一起,可以在除一个浏览器之外的所有浏览器中运行:Internet Explorer。好吧,它“有效”,但前提是您将鼠标缓慢移出 Flash 对象的左侧。

我在 Google 上搜索了很多答案,但似乎找不到有类似问题的人。

代码如下:

动作脚本代码:

_root.onLoad = function(){ _root.clip.skinAutoHide=true; _root.clip.skinFadeTime=0; } _root.onRollOver = function () { _root.clip.skinAutoHide=false; } _root.onRollOut = function () { _root.clip.skinAutoHide=true; _root.clip.skinFadeTime=0; }

网站代码(插入 flash 应该去的地方):


var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(hasRightVersion) {  // if we've detected an acceptable version
    // embed the flash movie
    AC_FL_RunContent(
        'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0',
        'width', '280',
        'height', '280',
        'src', '01clip1',
        'quality', 'best',
        'pluginspage', 'http://www.adobe.com/go/getflashplayer',
        'align', 'middle',
        'play', 'true',
        'loop', 'true',
        'scale', 'noscale',
        'wmode', 'transparent',
        'devicefont', 'false',
        'id', '01clip1',
        'bgcolor', '#ffffff',
        'name', '01clip1',
        'menu', 'true',
        'allowFullScreen', 'false',
        'allowScriptAccess','sameDomain',
        'movie', '01clip1',
        'salign', ''
        ); //end AC code
} else {  // flash is too old or we can't detect the plugin
    var alternateContent = 'Alternate HTML content should be placed here.'
        + 'This content requires the Adobe Flash Player.'
        + '@987654321@';
    document.write(alternateContent);  // insert non-flash content
}

任何见解将不胜感激。

【问题讨论】:

  • 嗨!可能完全不相关,但你真的需要你的 wmode 是透明的吗?尝试 opaque 或 window 以获得更好的性能,也许可以解决您的问题...
  • 我尝试了您的建议只是想看看它是否导致了问题,但它并没有解决问题。不幸的是,让我们这样做的客户希望它是透明的,因此视频(那个人走着说话,透明背景)看起来就像那个人走进了网页。

标签: flash actionscript internet-explorer-8 actionscript-2 flvplayback


【解决方案1】:

好的,我修好了。问题在于,在这种情况下,显然用于处理 mouseover/mouseout 的 AS2 方法并不能很好地工作。我将闪存更新为使用 AS3 并使用以下代码:


/*
Code lifted and slightly modified from:
http://board.flashkit.com/board/showthread.php?t=714795
*/
clip.skinAutoHide = false;
clip.skinBackgroundAlpha = 0;
clip.skin = "";

stage.addEventListener(Event.MOUSE_LEAVE, hideSkin);
stage.addEventListener(MouseEvent.MOUSE_MOVE, showSkin);

function showSkin(evt:Event=null):void {
    clip.skinBackgroundAlpha = 0.30;
    clip.skin = "SkinOverPlaySeekMute.swf";
}

function hideSkin(evt:Event=null):void {
    clip.skinBackgroundAlpha = 0;
    clip.skin = "";
}

我不完全确定为什么必须这样做,但这里仍然是所有其他人的代码。

干杯。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-21
    • 2010-12-03
    • 1970-01-01
    • 1970-01-01
    • 2010-12-31
    • 2012-06-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多