在actionscript3中延迟一段时间后显示按钮
我一直在使用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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您输入(
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 aflash.utils.Timer
with a callback function that sets the buttons alpha to 1.使用诸如 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.
所以我和某人交谈过,你显然也可以用动作脚本编写它,这样:
So I talked to someone, and you can apparently also write it in actionscript, this way: