我一直在使用 actionscript 3.0,并且有一个数组,可以在每个新页面上给我一些文本和一个按钮(单击按钮可以让我进入下一个文本页面和按钮)。我现在希望我的按钮不会立即出现在每个页面上,但是会延迟时间,可能要等待 10 秒左右才会出现。有谁知道我该怎么做?
问问题
1937 次
3 回答
1
当您输入(creationComplete
或类似)您的“页面”时,将按钮的 alpha 设置为 0,然后flash.utils.Timer
使用回调函数将按钮的 alpha 设置为 1。
于 2010-06-30T20:48:31.873 回答
0
因此,我与某人交谈,您显然也可以通过这种方式将其写在 actionscript 中:
/* 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;
}
于 2010-07-04T13:51:59.000 回答
0
使用像Tweenlite这样的东西可能是要走的路,它真的很容易使用,应该会给你想要的效果。
于 2010-06-30T20:48:21.217 回答