Variable and Function Definitions in Frame Scripts : MovieClip : Development Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Development » MovieClip »

 

Variable and Function Definitions in Frame Scripts


 
package {
  import flash.display.MovieClip;
  import flash.utils.Timer;
  import flash.events.TimerEvent;

  public class Main extends MovieClip {
    private var timer:Timer;

    public function Main() {
      timer = new Timer(1000);
      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(  );
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Development
» MovieClip