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

Tricky Hello World!

package 
{
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.utils.Dictionary;
	
	public class Hello extends Sprite
	{
		public function Hello()
		{
			文字列.を生成(笑);
			
			それに対して(わんだー).を追加(笑);
			
			それに対して(えふえる).を追加(笑);
			
			それを(めっせーじ).で覚える(笑);
			
			テキストフィールド.を生成(笑);
			
			それに対して(覚えた(めっせーじ)).を設定(笑);
			
			それを表示(笑);
		}
		
		private var _stack:Array = [];
		private var _dict:Dictionary = new Dictionary();
		
		private function push(obj:Object):void
		{
			_stack.push(obj);
		}
		
		private function pop():Object
		{
			return _stack.pop();
		}
		
		private function peek():Object
		{
			return _stack[_stack.length - 1];
		}
		
		public function get 笑():Object
		{
			return null;
		}
		
		public function get わんだー():String
		{
			return "wonder";
		}
		
		public function get えふえる():String
		{
			return "fl";
		}
		
		public function get めっせーじ():String
		{
			return "message";
		}
		
		public function get 文字列():Hello
		{
			push(String);
			return this;
		}
		
		public function get テキストフィールド():Hello
		{
			push(TextField);
			return this;
		}
		
		public function を生成(p:Object):void
		{
			var c:Class = pop() as Class;
			push(new c());
		}
		
		public function それに対して(p:Object):Hello
		{
			push(p);
			return this;
		}
		
		public function それを(p:Object):Hello
		{
			push(p);
			return this;
		}
		
		public function を追加(p:Object):void
		{
			var b:String = pop() as String;
			var a:String = pop() as String;
			push(a + b);
		}
		
		public function で覚える(p:Object):void
		{
			var k:Object = pop();
			var v:Object = pop();
			_dict[k] = v;
		}
		
		public function 覚えた(p:Object):Object
		{
			return _dict[p];
		}
		
		public function を設定(p:Object):void
		{
			var s:String = pop() as String;
			var tf:TextField = peek() as TextField;
			tf.text = s;
		}
		
		public function それを表示(p:Object):void
		{
			var tf:TextField = pop() as TextField;
			addChild(tf);
		}
	}
}