AS3 程序延迟执行的方法分享
平面设计 2021-07-03 14:34www.168986.cn平面设计培训
复制代码
代码如下:import flash.events.TimerEvent;
import flash.utils.Timer;
/
delay function
a quick and easy delay function that can call a function with parameters. configurable
with delay time and repeat frequency
@param func:Function The function to call when timer is plete
@param params:Array An array of parameters to pass to the function
@param delay:int [OPTIONAL] The number of milliseconds to wait before running the function
@param repeat:int [OPTIONAL] The number of times the function should repeat
/
private function delay(func:Function, params:Array, delay:int = 350, repeat:int = 1):void
{
var f:Function;
var timer:Timer = new Timer(delay, repeat);
timer.addEventListener(TimerEvent.TIMER, f = function():void
{
func.apply(null, params);
if (timer.currentCount == repeat)
{
timer.removeEventListener(TimerEvent.TIMER, f);
timer = null;
}
});
timer.start();
}
平面设计师
- 免费平面设计网站 免费平面设计绘图软件
- 平面设计基础知识题库
- 平面设计基础学包括哪些
- ui设计师工资一般多少 北京ui设计师工资一般多少
- 平面设计技巧方法 平面设计技巧总结
- 哪里的平面设计培训班比较好 哪家平面培训设计
- 哪些人不适合学平面设计 平面设计师工资一般多
- 女生学习平面设计还有其独特的优势
- 平面设计大学专业叫什么 平面设计大学专业叫什
- ui就业前景和工资待遇 ui就业前景和工资待遇怎么
- 平面设计ps入门教程 平面设计photoshop 基本操作方
- 免费学平面设计教程 平面设计免费教程网站
- 平面设计就业方向有哪些 平面设计专业就业前景
- 女生学什么设计前景好 女孩学什么设计好赚钱
- 什么人适合学平面设计 学平面设计后悔死了
- 平面设计内容有哪些 平面设计内容包括什么