[SWF(width="465", height="465", backgroundColor="0", frameRate="30")]
public class PointLightDemo extends Sprite {
private var fx:VolumetricPointLight;
private var grid:Grid = new Grid;
private var sun:SunIcon = new SunIcon;
public function PointLightDemo():void {
addEventListener(Event.ADDED_TO_STAGE, init);
if(null != stage) init();
private function init(e:Event = null):void {
removeEventListener(Event.ADDED_TO_STAGE, init);
stage.quality = "medium";
stage.scaleMode = "noScale";
fx = new VolumetricPointLight(800, 600, grid, [0xc08040, 0x4080c0, 0], [1, 1, 1], [0, 20, 30]);
stage.addEventListener(Event.RESIZE, onResize);
sun.addEventListener(MouseEvent.MOUSE_DOWN, function(e:Event):void { sun.startDrag(); });
sun.addEventListener(MouseEvent.MOUSE_UP, function(e:Event):void { sun.stopDrag(); });
addEventListener(Event.ENTER_FRAME, function(..._):void { fx.srcX = sun.x; fx.srcY = sun.y; });