Skip to content

Instantly share code, notes, and snippets.

@NicolaiSattler
Created October 20, 2011 16:15
Show Gist options
  • Select an option

  • Save NicolaiSattler/1301566 to your computer and use it in GitHub Desktop.

Select an option

Save NicolaiSattler/1301566 to your computer and use it in GitHub Desktop.
Background
package
{
import flash.display.GradientType;
import flash.display.Sprite;
import flash.events.Event;
public class Background extends Sprite
{
public function Background()
{
addEventListener(Event.ADDED_TO_STAGE, init);
}
public function init(e:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
drawMe();
}
public function drawMe():void
{
this.graphics.beginGradientFill(GradientType.RADIAL,[Math.random()*0xffffff,Math.random()*0xffffff],[0,1],[0,25]);
this.graphics.drawRect(0, 0, 800, 600);
this.graphics.endFill();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment