1 Reply Latest reply on Nov 2, 2009 10:11 PM by kglad

    Back btn function in flash wont work HELP!

    dustylylac

      So I'm making a music box in flash, I've programmed the forward button just fine so if I press the next_mc it skips to the next song, but my prev.mc is an issue! I only have 6 songs.

       

      //next song

       

      next_mc.addEventListener(MouseEvent.CLICK, nextSong);

       

      function nextSong(e:MouseEvent):void {
          if (trackNum< songList.length-1) {
              trackNum++
              currSong = "../MP3s/"+songList[trackNum] as String;
              }
             
              else { trackNum=0;
              currSong = "../MP3s/"+songList[trackNum] as String;
                 
                  }
             
          if (snd != null) {
              channel.stop();
          }
          snd = new Sound();
          snd.load(new URLRequest(currSong));
         
          channel = new SoundChannel  ;
          trans = new SoundTransform(currVol,currPan);
          channel = snd.play();
          channel.soundTransform = trans;
          panSlide.visible = true;
          volSlide.visible = true;

       

       

       

      I can't get the back previous button working for the life of me! Any help would be great, thanks!

       

       

       

      /*//previous song

       

      prev_mc.addEventListener(MouseEvent.CLICK, prevSong);

       

      function prevSong(e:MouseEvent):void {
          if (trackNum < 0) {
              trackNum--
              currSong = "../MP3s/"+songList[trackNum] as String;
              }
             
              else { trackNum= songList.length-1;
              currSong = "../MP3s/"+songList[trackNum] as String;
                 
                  }
             
          if (snd != null) {
              channel.stop();
          }
          snd = new Sound();
          snd.load(new URLRequest(currSong));
         
          channel = new SoundChannel  ;
          trans = new SoundTransform(currVol,currPan);
          channel = snd.play();
          channel.soundTransform = trans;
          panSlide.visible = true;
          volSlide.visible = true;
          */
         

        • 1. Re: Back btn function in flash wont work HELP!
          kglad Adobe Community Professional & MVP

          :

           


           

           

           

          /*//previous song

           

          prev_mc.addEventListener(MouseEvent.CLICK, prevSong);

           

          function prevSong(e:MouseEvent):void {
              if (trackNum ==0) {
                  trackNum=songList.length-1

                  currSong = "../MP3s/"+songList[trackNum] as String;
                  } else {

                  trackNum--;

                  currSong = "../MP3s/"+songList[trackNum] as String;
                   }
                 
              if (snd != null) {
                  channel.stop();
              }
              snd = new Sound();
              snd.load(new URLRequest(currSong));
             
              channel = new SoundChannel  ;
              trans = new SoundTransform(currVol,currPan);
              channel = snd.play();
              channel.soundTransform = trans;
              panSlide.visible = true;
              volSlide.visible = true;
              */