DotSprite
package {
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.system.Capabilities;
public class DotSprite extends Sprite {
public function DotSprite() {
var dotSprite:Sprite = new Sprite();
var sp:Sprite = dot();
var bt:BitmapData = new BitmapData(sp.width, sp.height);
bt.draw(sp);
dotSprite.graphics.beginBitmapFill(bt);
dotSprite.graphics.drawRect(0, 0, Capabilities.screenResolutionX, Capabilities.screenResolutionY);
dotSprite.graphics.endFill();
addChild(dotSprite);
}
private function dot(distance:int=3,size:int=5,color:uint = 0x000000,alphaNum:Number=0.5):Sprite {
var sp:Sprite = new Sprite();
sp.graphics.beginFill(color,alphaNum);
sp.graphics.drawRect(distance, distance, size, size);
sp.graphics.endFill();
return sp;
}
}
}