// CSE 190m, Flash Sessions // Homework 2 // Instructor provided code that you SHOULD modify package { import flash.display.Sprite; import flash.events.Event; [SWF(backgroundColor="#000000", frameRate="50", width="500", height="500")] public class GravityMain extends Sprite { public function GravityMain():void { // initialize simulation drawPlanet(); } // draws a red planet in the center of the stage private function drawPlanet():void { graphics.beginFill(0xFF0000); graphics.drawCircle(stage.stageWidth / 2, stage.stageHeight / 2, 30); graphics.endFill(); } // event handler for the enter frame event; runs multiple times a second. private function onEnterFrame(e:Event):void { } // accepts a Moon object and a target x and y and "pulls" the moon // toward the target coordinates by applying a pseudo-gravitational // force. private function gravitate(m:Moon, tx:Number, ty:Number):void { } } }