[CodeDump]

As suggested by Wanni, here’s a codedump page where I release some code that I often use. If this expands, I guess it will have to be a microsite, but for now, it’s small, so it’s just going to be a page. If you want to dump code here too, let me know via an email please. Thanks and Enjoy!

Actionscript

  • Functions
    • Countdown
    • [code lang="actionscript"]
      function countdown(n) {
      _root.createEmptyMovieClip(”timeControl_mc”,100);
      time = n;
      startTime = getTimer();
      timeControl_mc.onEnterFrame = function() {
      var endTime = getTimer();
      if (endTime-startTime>1000) {
      time–;
      startTime = getTimer();
      if (time<1) {
      //call whatever function here
      delete this.onEnterFrame;
      }
      }
      };
      }
      [/code]
      Usage: Just call countdown(time in seconds). Then change //call whatever function here to the function name that you want after the countdown is reached.

  • Flash functions
    • Microphone
    • [code lang="actionscript"]
      this.createEmptyMovieClip(“sound_mc”, this.getNextHighestDepth());
      System.showSettings(2);
      var active_mic:Microphone = Microphone.get();
      sound_mc.attachAudio(active_mic);
      active_mic.onStatus = function(infoObj:Object) {
      trace(active_mic.muted);
      if (active_mic.muted) {
      //put function here to activate NO MICROPHONE code
      }else{
      //put function here to activate MICROPHONE code
      }
      };
      [/code]
      Usage: The basic code needed to initialize the Microphone in Flash.