flash on 2011-10-8

by grapefrukt
♥0 | Line 31 | Modified 2011-10-12 20:54:50 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.events.Event;
    import flash.utils.Dictionary
     
    public class FlashTest extends Sprite {
        
        private var tf:TextField; 
        
        public function FlashTest() {
            
            tf = new TextField();
            tf.defaultTextFormat = new TextFormat("_sans");
            tf.height = 500;
            tf.width = 500;
            tf.x = 10;
            tf.y = 30;
            tf.selectable = false;
            addChild(tf);           
           
            var d:Dictionary = new Dictionary();
            d["foo"] = "bar";
            trace(d["foo"] + ", " + d.hasOwnProperty("foo"));
            delete(d["foo"]);
            trace(d["foo"] + ", " + d.hasOwnProperty("foo"));
            
            var thing:Sprite = new(Sprite);
            trace(thing.toString());
           
            trace((thing as(Sprite)).toString());
           
        }
        
        public function trace(text:String):void{
            tf.appendText(text + "\n");
        }
    }
}

Forked