[英]Flash Player scripting + IE8
I've developed a small control bar for a Flash viewer generated by a third-party software. 我为第三方软件生成的Flash查看器开发了一个小型控制栏。 It has a First, Prev, Next & Last button, and a Zoom command.
它具有“上一个”,“上一个”,“下一个和最后一个”按钮以及一个“缩放”命令。
While Zoom works fine in all browsers, the navigation buttons seem to fail at Internet Explorer 8. 尽管“缩放”在所有浏览器中都可以正常工作,但Internet Explorer 8上的导航按钮似乎失效。
I use at least two functions. 我至少使用两个功能。 This one locates the Flash object I want to manipulate:
这找到我要操作的Flash对象:
function getFlashMovieObject(movieName)
{
if (window.document[movieName])
{
return window.document[movieName];
}
if (navigator.appName.indexOf("Microsoft Internet")==-1)
{
if (document.embeds && document.embeds[movieName])
return document.embeds[movieName];
}
else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
{
return document.getElementById(movieName);
}
}
...and any of these ones handles the frame navigation: ...其中任何一个都可以处理帧导航:
var currentFrame = 0;
function gotoFirst(id)
{
getFlashMovieObject(id + "Blueprints").Rewind();
currentFrame = 0;
$("currentFrame").innerHTML = currentFrame + 1;
$("frameTitle").innerHTML = frameTitles[id][currentFrame];
}
function gotoPrev(id)
{
var movie = getFlashMovieObject(id + "Blueprints");
if (currentFrame > 0)
{
currentFrame--;
}
movie.GotoFrame(currentFrame);
$("currentFrame").innerHTML = currentFrame + 1;
$("frameTitle").innerHTML = frameTitles[id][currentFrame];
}
function gotoNext(id)
{
var movie = getFlashMovieObject(id + "Blueprints");
if (currentFrame < movie.TotalFrames() - 1)
{
currentFrame++;
}
movie.GotoFrame(currentFrame);
$("currentFrame").innerHTML = currentFrame + 1;
$("frameTitle").innerHTML = frameTitles[id][currentFrame];
}
function gotoLast(id)
{
var movie = getFlashMovieObject(id + "Blueprints");
currentFrame = movie.TotalFrames() - 1;
movie.GotoFrame(currentFrame);
$("currentFrame").innerHTML = currentFrame + 1;
$("frameTitle").innerHTML = frameTitles[id][currentFrame];
}
Btw, that $ is MooTools, not jQuery. 顺便说一句,$是MooTools,而不是jQuery。
Anyway, IE dies on the movie.TotalFrames()
call. 无论如何,IE死在
movie.TotalFrames()
调用上。 What can I do to solve this? 我该怎么解决? Keep in mind I need this to be done via JavaScript, as I cannot edit the SWF.
请记住,我需要通过JavaScript完成此操作,因为我无法编辑SWF。
You can try replacing this code: 您可以尝试替换以下代码:
if (currentFrame < movie.TotalFrames() - 1)
with this 有了这个
if (currentFrame < movie.TGetProperty('/', 5) - 1)
It's not as nice, but is another option. 它不是很好,但是是另一种选择。
TotalFrames()
should work. TotalFrames()
应该可以工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.