In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

new function

Get Adobe Flash player
by paq 15 Dec 2010
    Embed
/**
 * 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);
        }
    }
    
}