3 Replies Latest reply on May 26, 2007 7:24 AM by kglad

    Statement must appear within on/onClipEvent handler

    mydoofy
      Hello. I have an MP3 player built into my presentation but when I go to test my movie the following 3 AS errors come up. My code is below as well. Could someone assist me in finding out where my problem is?

      Thank you very much for any guidence. :)


      **Error** Screen=presentation, layer=bg overlay lines, frame=1:Line 1: Statement must appear within on/onClipEvent handler
      volumeDragging = false;

      **Error** Screen=presentation, layer=bg overlay lines, frame=1:Line 2: Statement must appear within on/onClipEvent handler
      function playNewSong() {

      **Error** Screen=presentation, layer=bg overlay lines, frame=1:Line 16: Statement must appear within on/onClipEvent handler
      mp3Player.onLoad = playNewSong();

      Total ActionScript Errors: 3 Reported Errors: 3








      volumeDragging = false;
      function playNewSong() {
      clearInterval(soundDuration);
      mp3Player.mySound.position = 0;
      mp3Player.mySound.duration = 0;
      mp3Player.progressBar._width = 0;
      mp3Player.mySound = new Sound();
      mp3Player.mySound.onSoundComplete = playNewSong;
      randomSound = random(4)+1;
      mp3Player.mySound.loadSound("bgSound"+randomSound+".mp3", 1);
      soundDuration = setInterval(durSong, 1000);
      function durSong() {
      mp3Player.progressBar._width = Math.round((mp3Player.mySound.position/mp3Player.mySound.duration)*31);
      }
      }
      mp3Player.onLoad = playNewSong();