0

我有一个问题。我将我的 Flash 按钮与 jQuery 和淡入/淡出连接工作得非常好。

但是当我添加这段代码时我遇到了问题:

navigateToURL(new URLRequest("contact.html"), "_self");

为了这:

function onClick(event:MouseEvent):void {
    ExternalInterface.call("myfadeout");
}
navigateToURL(new URLRequest("contact.html"), "_self");

如果我单击不起作用,则淡出,因为 navigateToURL 不接受来自 jQuery 的 .delay mettod。此方法需要其他 .delay 效果

如果我单击按钮,我只需要 3 秒暂停,并且在 3 秒后 jQuery 淡出页面和 navigateToURL 开始链接到 contact.html

请帮我。我是平面设计师,我不太擅长动作脚本。;)

4

2 回答 2

1

使用setTimeout.

function onClick(event:MouseEvent):void {
    ExternalInterface.call("myfadeout");
    setTimeout(navigate, 3000);
}

function navigate(){
    navigateToURL(new URLRequest("contact.html"), "_self"); 
}

您必须导入才能使用它

import flash.utils.setTimeout;
于 2013-10-22T22:41:02.300 回答
1
import flash.utils.setTimeout;

function ContactBtnClick(event:MouseEvent):void {
    ExternalInterface.call("myfadeout");
    setTimeout(function() {
        navigateToURL(new URLRequest("contact.html"), "_self"); 
    }, 3000);
}

function AboutBtnClick(event:MouseEvent):void {
    ExternalInterface.call("myfadeout");
    setTimeout(function() {
        navigateToURL(new URLRequest("about.html"), "_self"); 
    }, 3000);
}   

function AnotherBtnClick(event:MouseEvent):void {
    ExternalInterface.call("myfadeout");
    setTimeout(function() {
        navigateToURL(new URLRequest("another.html"), "_self"); 
    }, 3000);
}
于 2013-10-22T23:14:43.930 回答