/**
* Copyright 9dim ( http://wonderfl.net/user/9dim )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/p9N6
*/
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Timer;
public class FlashTest extends Sprite {
private var Line : Number = 7 ;
private var Split : int = 20;
//not used
private var Velocity : int = 1 ;
private var Distance : int = 0 ;
public function FlashTest() {
//update per frame
addEventListener(Event.ENTER_FRAME, ToForward);
}
private function ToForward(e:Event):void
{
var i : int ; //Loop Counter
var X : int = stage.stageWidth ;
var Y : int = stage.stageHeight ;
//BackGround
graphics.clear();
graphics.beginFill(0x000000,1);
graphics.drawRect(0,0,X,Y);
graphics.endFill();
//Base Line
for (i=0;i<=Line;i++){
graphics.lineStyle(1,0x00FFFF,0.5);
graphics.moveTo(X*i/Line,0);
graphics.lineTo(X/2,Y/2);
graphics.lineTo(X*i/Line,Y);
graphics.moveTo(0,Y*i/Line);
graphics.lineTo(X/2,Y/2);
graphics.lineTo(X,Y*i/Line);
}
var x : int ;
var y : int ;
//Square
for (i=1;i<250;i++){
graphics.lineStyle(0.5+0.004*(250-i),0x00FFFF,0.4+0.001*250/i);
x = X / (i + Split/20);
y = Y / (i + Split/20);
graphics.drawRect((X-x)/2,(Y-y)/2,x,y);
}
if(Split-- == 1){Split = 20;}
}
}
}