prototype-based programming
/**
* Copyright tosik ( http://wonderfl.net/user/tosik )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/yUm4
*/
package {
import flash.text.TextField;
import flash.display.Sprite;
public class PrototypeBasedProgramming extends Sprite {
public function PrototypeBasedProgramming() {
var hello:HelloWorld = new HelloWorld;
var textfield:TextField = new TextField;
addChild(textfield);
Object.prototype.say = function():String
{
return "Awesome!";
};
textfield.text = hello.say();
}
}
}
dynamic class HelloWorld
{
}