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

Adobe MAX Japan 2009 城戸さんのデモ再現(1)

---------------------------------------------------------*
*
* Adobe MAX Japan 2009 城戸さんのデモ再現
*
* プレゼン映像はこちら
* http://jp.max.adobe.com/player.html?2-10
*
*---------------------------------------------------------
Get Adobe Flash player
by littlepad 06 Apr 2009
/*---------------------------------------------------------*
 *
 * Adobe MAX Japan 2009 城戸さんのデモ再現
 *
 * プレゼン映像はこちら
 * http://jp.max.adobe.com/player.html?2-10
 *
 *---------------------------------------------------------*/
package {
    import flash.display.*;
    import flash.events.*;
    
    public class Test extends Sprite {
        private var ポイント:Object;
        private var ボックス:Box;
        
        public function Test(){
            init();
        }
        
        private function init():void {
            ポイント= { x:100, y:300 };
            ボックス = new Box();
            addChild(ボックス);
            
            addEventListener(Event.ENTER_FRAME, モーション);
            addEventListener(Event.ENTER_FRAME, レンダリング);
        }
        
        private function モーション(e:Event):void {
            ポイント.x += 2;
        }
        
        private function レンダリング(e:Event):void {
            ボックス.x = ポイント.x;
            ボックス.y = ポイント.y;
        }
    }
}

import flash.display.*;
import flash.text.*;

class Box extends Sprite {
    public function Box() {
        var rect:Shape=new Shape();
        rect.graphics.beginFill(0x000000);
        rect.graphics.lineStyle(0);
        rect.graphics.drawRect(0,0,30,30); 
        rect.graphics.endFill();
        rect.x = -rect.width/2;
        rect.y = -rect.height/2;
        addChild(rect);
        
        var tFld:TextField = new TextField();
        var tFmt:TextFormat = new TextFormat();
        tFmt.color = 0xFFFFFF;
        tFmt.size = 24;
        tFmt.align = TextFormatAlign.CENTER;
        tFld.defaultTextFormat = tFmt;
        tFld.width = rect.width;
        tFld.text = "A";
        tFld.height = tFld.textHeight;
        tFld.x = -tFld.width/2;
        tFld.y = -tFld.height/2;
        addChild(tFld);
    }
}