cfdelegate.as
来自「flash强大事件机制扩展类」· AS 代码 · 共 29 行
AS
29 行
/*
@Description: 在指定范围内运行函数.原类:mx.utils.Delegate;
@usage: CFDelegate.create(要运行函数的范围, 函数);
@example:
//运行在主时间轴.
import AS2.utils.CFDelegate;
mc.onRelease = _release; //output: _level0.mc
mc.onRelease = EventDelegate.create(this, _release); //output: _level0
funcion _release():Void
{
trace(this);
}
//
@author: ChooseFlash 修改
@date: 2007-07-07
*/
class AS2.utils.CFDelegate
{
public static function create(scope:Object, method:Function):Function
{
var f:Function = function ()
{
method.apply(scope, arguments);
};
return f;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?