在actionscript3中延迟一段时间后显示按钮

发布于 2024-09-07 13:17:08 字数 141 浏览 1 评论 0原文

我一直在使用actionscript 3.0,并且有一个数组,它可以在每个新页面上为我提供一些文本和一个按钮(单击该按钮可以让我进入下一个文本页面和按钮)。我现在希望我的按钮不会立即出现在每个页面上,但会延迟时间,可能要等待 10 秒左右才会出现。有谁知道我该怎么做?

I've been working with actionscript 3.0 and have an array that gives me some text and a button on each new page (clicking the button gets me to the next text-page and button). I'd now like my button to not appear on each page immediately, but time delayed, maybe wait 10 seconds or so before it appears. Does anyone have an idea how I could do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

Spring初心 2024-09-14 13:17:08

当您输入(creationComplete 或类似内容)您的“页面”时,将按钮的 alpha 设置为 0,然后启动 flash.utils.Timer 带有将按钮 alpha 设置为 1 的回调函数。

When you enter (creationComplete or similar) your "page" set the button's alpha to 0 then kick off a flash.utils.Timer with a callback function that sets the buttons alpha to 1.

七颜 2024-09-14 13:17:08

使用诸如 Tweenlite 之类的东西可能是可行的方法,它非常易于使用,并且应该为您提供您正在寻找的效果。

Using something like Tweenlite might be the way to go, its really easy to use and should give you the effect you are looking for.

森林很绿却致人迷途 2024-09-14 13:17:08

所以我和某人交谈过,你显然也可以用动作脚本编写它,这样:

    /* Define a Timer and how long it runs, here 5 sec */

stop();

var timer1:Timer = new Timer(5000);

timer1.addEventListener(TimerEvent.TIMER, hideButtonTimer1);

    /* Define the button going to the next frame on mouseclick */

btn_name.addEventListener(MouseEvent.CLICK, next);

function next(event:MouseEvent) {
    play();
}

    /* Hide the button on start of the timer */

btn_name.visible = false;

timer1.start();

    /* turn the button visible when the timer stops */

function hideButtonTimer1(e:Event) 

{timer1.stop();

btn_name.visible = !btn_name.visible;

}

So I talked to someone, and you can apparently also write it in actionscript, this way:

    /* Define a Timer and how long it runs, here 5 sec */

stop();

var timer1:Timer = new Timer(5000);

timer1.addEventListener(TimerEvent.TIMER, hideButtonTimer1);

    /* Define the button going to the next frame on mouseclick */

btn_name.addEventListener(MouseEvent.CLICK, next);

function next(event:MouseEvent) {
    play();
}

    /* Hide the button on start of the timer */

btn_name.visible = false;

timer1.start();

    /* turn the button visible when the timer stops */

function hideButtonTimer1(e:Event) 

{timer1.stop();

btn_name.visible = !btn_name.visible;

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文