Handling Events: a simple application that draws successive random lines
package {
import flash.display.Sprite;
import flash.events.Event;
public class Main extends Sprite {
public function Main( ) {
graphics.lineStyle(1, 0, 1);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(event:Event):void {
graphics.lineTo(Math.random( ) * 400, Math.random( ) * 400);
}
}
}
Related examples in the same category