topical media & game development

talk show tell print

actionscript-misc-Star.ax

actionscript-misc-Star.ax [swf] flex


  package {
    import flash.display.MovieClip;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
  
    public class @ax-actionscript-misc-Star extends MovieClip {
      private var timer:Timer;
  
      public function @ax-actionscript-misc-Star () {
        timer = new Timer(100, 0);
        timer.addEventListener(TimerEvent.TIMER, timerListener);
        timer.start();
      }
  
      private function timerListener (e:TimerEvent):void {
        randomFade();
      }
  
      private function randomFade ():void {
        alpha = Math.random();
      }
  
      public function dispose ():void {
        timer.stop();
      }
    }
  }


(C) Æliens 27/08/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.