flash on 2011-10-8
♥0 |
Line 31 |
Modified 2011-10-12 20:54:50 |
MIT License
archived:2017-03-20 12:02:05
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");
}
}
}