new function

by paq
♥2 | Line 19 | Modified 2010-12-15 14:23:51 | MIT License
play

ActionScript3 source code

/**
 * Copyright paq ( http://wonderfl.net/user/paq )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/qxVy
 */

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"
            }
            var f:Object = new func();
            var tf:TextField = new TextField();
            tf.text = f.str;
            addChild(tf);
        }
    }
    
}

Forked