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

forked from: See-through window

Get Adobe Flash player
by rudro 04 Feb 2009
    Embed
// forked from yuku's See-through window
package {
    import flash.display.*;
    import flash.filters.*;
    import flash.events.*;
    import flash.text.*;

    public class FlashTest extends Sprite {

        var mx = NaN, my = NaN;
        var b = new Sprite();

        public function FlashTest() {
            // write as3 code here..
            var a: Sprite = new Sprite();
            var t = new TextField();
            t.defaultTextFormat = new TextFormat(null, null, 0xffff00);
            t.text = "move your mouse.\ngoyangin tikusnya.\nマウスを動かせ";
            t.filters = [new DropShadowFilter()];
            t.scaleX = t.scaleY = 3;
            var W = stage.stageWidth;
            var H = stage.stageHeight;

            gambar(a, W/2, H/2);

            stage.addEventListener(MouseEvent.MOUSE_MOVE, function(e) {
                mx = e.stageX;
                my = e.stageY;
                
                b.graphics.clear();
                gambar(b, mx, my);
                
                if (t.parent) removeChild(t);

                e.updateAfterEvent();
            });

            addChild(a);
            addChild(b);
            addChild(t);
        }

        public function gambar(a: Sprite, x, y) {
            with (a.graphics) {
                for (var i = 0; i < 80; i++) {
                    var c = 0xff * i / 80;
                    lineStyle(Math.sqrt(i)*1.5, c | c << 8 | c << 16);
                    drawCircle(x, y, i*10);
                }
            }
        }

    
    }
}