I am pretty new to AS, and I have been using flash mx 2004 and thus AS 2.0. I was under the impression that the use of prototype was no longer needed because of how inheritence is now handle in AS 2.0. Is this true? I see lots of people posting code with use of prototype in it. Like voetsjoeba who posted a cool easing function that uses prototype. Maybe someone could show me how it might work in AS 2.0 without the use of prototype.
MovieClip.prototype.easeX = function(to){
this.onEnterFrame = function(){
this._x = to-(to-this._x)/1.1;
if(this._x > to-1 && this._x < to+1){
this._x = to;
delete this.onEnterFrame
//do other stuff here, this is the point at which the object reaches its target
}
}
}
MC.easeX(100);
thanks,
Brian