プロトタイプ継承(?)
forked from new function (diff: 8)
ActionScript3 source code
/**
* Copyright Nicolas ( http://wonderfl.net/user/Nicolas )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/qH8G
*/
// forked from paq's new function
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
/**
* function は new できる
* @author paq89
*/
public class Main extends Sprite
{
public function Main():void
{
function func():void {
this.str = "wonderfl"
}
function funcEx():void{
this.str2 = "jsdo.it";
}
funcEx.prototype = new func();
var f:Object = new funcEx();
var tf:TextField = new TextField();
tf.text = f.str + "\n" + f.str2;
addChild(tf);
}
}
}