I am trying to incorporate prototype.js's bind()
function into my Flash component. I found this article by Jordan Broughs, which gave me hope. He suggested using this code snippet:
Function.prototype.bind = function():Function {
var __method:Function = this;
var object:Object = arguments[0];
return function():void {
__method.apply(object, arguments);
}
}
So, I put that in my class, outside of any methods or constructors. However, when I try to call bind() on a function, I get this compiler error:
1061: Call to a possibly undefined method bind through a reference with static type Function.
Any ideas?