title: AS3 - remove external interface callback during loading?
body: <p>I have a series of 10 external interface callbacks that are called through javascript and load mp3 files.  The problem is, someone is able to click these while my pre-load function is running and it causes multiple files to load.  Is there a way to disable the callbacks while the pre-load function is running?</p>
  
  <pre><code> ExternalInterface.addCallback("receiveText1", receiveText1);
  
  function receiveText1(value:String):void {
  
  
          channel.stop();
          channel2.stop();
          lblSongTime.alpha = 0;
          lblSongTotalTime.alpha = 0;
          songPosition = 0;
          soundFile2 = new URLRequest(jsVariableValue1);
          myMusic2= new Sound();  //Intstantation
          myMusic2.addEventListener(ProgressEvent.PROGRESS, onLoadProgress2, false,0, true);
          myMusic2.addEventListener(Event.COMPLETE, playMusicNow, false, 0,true);
          myMusic2.load(soundFile2, myContext);
          soundFile2exist = null;
          trace("text1");
          }
  </code></pre>
  
  <p>loading function</p>
  
  <pre><code>function onLoadProgress2(evt:ProgressEvent):void {
      channel.stop();
      channel2.stop();
      songPosition = 0;
      btnPlay.mouseEnabled = false;
      progBar.alpha = .70;
      prcLoaded.alpha = .70;
      var pcent:Number=evt.bytesLoaded/evt.bytesTotal*100;
      prcLoaded.text =int(pcent)+"%";
      progBar.width =  90 * (evt.bytesLoaded / evt.bytesTotal);
  }
  </code></pre>