package { import flash.display.Sprite; import flash.filters.DropShadowFilter; public class Globe extends Sprite { private var globe:Sprite public function Globe() { addChild(globe = new Sprite()).filters = [ new DropShadowFilter(0, 0, 0x0000ff, 1, 10, 10, 2, 3)] for (var c:Number = 0; c < 500; c++ ) with (globe.addChild(new Sprite())) { graphics.lineStyle(0, 0x0000ff) graphics.lineTo(50+Math.random()*150, 0) graphics.endFill() rotationY = Math.random() * 360 rotationZ = Math.random() * 360 transform.matrix3D.prependTranslation(100, 0, 0) } stage.addEventListener('resize', onStageResize) addEventListener('enterFrame',onEnterFrame) onStageResize() } private function onEnterFrame(...e):void { globe.rotationX -- globe.rotationY ++ var z:Number var child:Sprite for (var c:Number = 0; c < globe.numChildren; c++ ) { child = globe.getChildAt(c) as Sprite z = child.transform.getRelativeMatrix3D(root).position.z if ((child.visible = z > 0)) child.alpha = z/100 } } private function onStageResize(...e):void { globe.x = stage.stageWidth / 2 globe.y = stage.stageHeight / 2 } } }