Created
October 20, 2011 16:15
-
-
Save NicolaiSattler/1301566 to your computer and use it in GitHub Desktop.
Background
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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