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: forked from: アステロイド (eye version)

sorry about the bad formatting...
/**
 * Copyright pipeep ( http://wonderfl.net/user/pipeep )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/vZnW
 */

// forked from makc3d's forked from: アステロイド (eye version)
// forked from 178ep3's アステロイド (eye version)
// sorry about the bad formatting...
package 
{
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.geom.Point;
    
    
    
    public class stepLine extends Sprite
    {
        private var step:uint=4;
        private var rp:Point;
	
	    public function stepLine()
	    {
                var n:uint = stage.stageWidth / step;
		for(var i:uint=0; i<n; i++)
		{
		    with(this.graphics)
		    {
		        lineStyle(1,0x000000,0.5);
		        moveTo(0,i*step);
     	                lineTo(i*step,stage.stageHeight);

		        moveTo(stage.stageWidth,i*step);
	   	        lineTo(i*step,0);

                        if (i % 2 == 0) {
		            lineStyle(1,0x007FFF,0.5);
		            drawCircle (
                                stage.stageWidth * (0.5 + 0.1 * Math.sin (2 * i * Math.PI / n)),
				stage.stageHeight * (0.5 + 0.1 * Math.cos (2 * i * Math.PI / n)),
				stage.stageWidth / 6
			    );
                        }
	            }
		}
                //var bData:BitmapData = new BitmapData(width, height);
                //bData.draw(this);
                //var bMap:Bitmap = new Bitmap(bData);
                //addChild(bMap);
                //this.graphics.clear();
                rp = new Point(width/2, height/2);
                new flash.display.MovieClip().addEventListener("enterFrame", function funct( event:Event ):void { setProperty2("rotation", rotation+1); setProperty2("scaleX", scaleX+.01); setProperty2("scaleY", scaleY+.01); } );
                
    }
    
    public function setProperty2(prop:String, n:Number):void
		{
                    
var a:Point = this.parent.globalToLocal(this.localToGlobal(rp));

			this[prop] = n;

			var b:Point = this.parent.globalToLocal(this.localToGlobal(rp));

			this.x -= b.x - a.x;
			this.y -= b.y - a.y;
		}
}
}