/**
* Adapter
*
* @author: http://www.flash8corders.com, themagu edit by showjean
* @version: 0.0.0
* @date:
*
* @comment: Delegate의 확장형, 파라메터를 전달할 수 있다.
*/
class com.showjean.utils.Adapter {
//edited 07.07.01 by showjean
public static function wrap(target:Object, func:Function):Function {
var adapter:Function = function ():Object {
var self:Function = arguments.callee;
var target:Object = self.target;
var param:Array = arguments.concat(self.param);
return self.func.apply(target, param);
};
adapter.target = arguments.shift();
adapter.func = arguments.shift();
adapter.param = arguments;
return adapter;
}
}