What I would like to do is something like the following:
FooClass.prototype.method = function():String
{
return "Something";
}
var foo:FooClass = new FooClass();
foo.method();
That is, I would like to extend the generated class with one method, and not through inheritance, but through a prototype.
The class is created from WSDL, it is not a dynamic class, and I do not want to touch the generated code, because it will be overwritten anyway.
In short, I would like to have the moral equivalent of C # 3: s Extension Methods for AS3.
Edit: I accepted the answer from aib because it matches what I asked best - although with further thought it really does not solve my problem, but it’s my fault that you asked the wrong question. :) Also, upmods are for good suggestions.