/ Published in: ActionScript 3

Got this out of the o'reilly ActionScript 3.0 Cookbook
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package { import flash.display.Sprite; import flash.events.Event; public class ExampleApplication extends Sprite{ public function ExampleApplication(){ graphics.lineStyle(1,0,1); addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(event:Event):void{ graphics.lineTo(Math.random() * 400, Math.random() * 400); } } }
Comments
