Posted By

mswallace on 06/26/07


Tagged

event listener onEnterFrame


Versions (?)

Who likes this?

8 people have marked this snippet as a favorite

bartekk
copyleft
andrewrench
fukami
abdsign
taboularasa
THEPWN3R
donaldleegraham


onEnterFrame Event using Actionscript 3


 / Published in: ActionScript 3
 

Got this out of the o'reilly ActionScript 3.0 Cookbook

  1. package {
  2. import flash.display.Sprite;
  3. import flash.events.Event;
  4.  
  5. public class ExampleApplication extends Sprite{
  6.  
  7. public function ExampleApplication(){
  8. graphics.lineStyle(1,0,1);
  9. addEventListener(Event.ENTER_FRAME, onEnterFrame);
  10. }
  11. private function onEnterFrame(event:Event):void{
  12. graphics.lineTo(Math.random() * 400, Math.random() * 400);
  13. }
  14. }
  15. }

Report this snippet  

You need to login to post a comment.