Actionscript onMouseOut 侦听器在 Internet Explorer 8 下不完全工作
我正在使用 Flash CS4 开发视频播放器。我正在尝试构建播放器,以便当用户将鼠标移到 Flash 对象上时,播放控件会出现,而当用户将鼠标移出 Flash 对象时,控件会消失。
我设法将一些代码放在一起,可以在除 Internet Explorer 之外的所有浏览器中运行。好吧,它“有效”,但前提是您将鼠标慢慢移到 Flash 对象的左侧。
我已经在谷歌上搜索了很多答案,但我似乎找不到有类似问题的人。
代码如下:
ActionScript 代码:
_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.'
+ 'Get Flash';
document.write(alternateContent); // insert non-flash content
}
任何见解将不胜感激。
I am working on a video player in Flash CS4. I'm trying to build the player such that when the user moves their mouse over the flash object, the playback controls appear and, when the user moves the mouse out of the flash object, the controls disappear.
I managed to get some code put together that works in every browser but one: Internet Explorer. Well, it 'works' but only if you slowly move the mouse out on the left side of the flash object.
I have done quite a bit of Google searching for an answer, but I can't seem to find someone with a similar problem.
Code is as follows:
ActionScript Code:
_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;
}
Website Code (Inserted where the flash should go):
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.'
+ 'Get Flash';
document.write(alternateContent); // insert non-flash content
}
Any insight would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我修好了。问题是显然 AS2 处理 mouseover/mouseout 的方法在这种情况下并不能很好地工作。我更新了闪存以使用 AS3 并使用了以下代码:
我不完全确定为什么必须这样做,但这里的代码仍然适用于所有其他在那里用头撞桌子的人。
干杯。
Alright, I fixed it. The issue was that apparently the AS2 methods for working with mouseover/mouseout don't really work well in this instance. I update the flash to use AS3 and used the following code:
I'm not entirely sure why it had to be done this way, but here's the code nonetheless for all you other people out there banging your head against your desk.
Cheers.