8 Replies Latest reply on Jul 20, 2015 8:01 PM by geeg75866824

    Please help I have an error on line 1080 else is not expected 44 that I can't seem to fix, any thoughts?

    geeg75866824

      import flash.media.Sound;

      import flash.media.SoundLoaderContext;

      import flash.events.Event;

       

      stop();

      var snd:Sound = new Sound();

      var channel:SoundChannel;

      var context:SoundLoaderContext = new SoundLoaderContext(5000, true);

      snd.load(songURL, context);

      channel = snd.play(pausePosition); // Start playing

      // Playlist item click listener

      list.addEventListener(Event.CHANGE, itemClick);

      // Playlist item click function

      function itemClick (event:Event):void {

          channel.stop(); // stop play

          status_txt.text = "Now Playing: " + event.target.selectedItem.label + ".mp3";

          trackToPlay = event.target.selectedItem.songString;

          gotoAndPlay(2);

      }

      ////////////////////////////////////////////////////////////////////

      //stop button listener

      stop_btn.addEventListener(MouseEvent.click, stopPlayer);

      ///stop button function

      function stopPlayer  (event:MouseEvent):void{

          channel.stop();

      }

      ////////////////////////////////////

      ////event listener

      channel.addEventListener(Event.SOUND_COMPLETE, onCompletePlayback);

      /// function and

      function onComletePlayback(event:Event):void{

          newTrack();

          //function new track()

          // New track play function

      function newTrack():void {

           if (list .selectedItem .songNum == i) { // if songNum == total track amount

               channel .stop();  // stop the player

               var selectFirst = new Array (0,0); // array for cell select

               list.selectedIndices = selectFirst; // This selects song 1

               list.scrollToIndex(0);

               trackToPlay = list.selectedItem.songString; // Define New track to play

               status_txt=text= list. selectedItem; Label+"mp3"

               gotoAndPlay(2)}; // Make the switch and play

           }   else {  ////right here I get the error

               channel.stop();  // stop the player

               var sn:uint = list.selectedItem.songNum; // var that has value of current list songNum

               var selectNext = new Array (sn,sn); // array for cell select

               list.selectedIndices = selectNext; // This selects next song in the list component

               list.scrollToIndex(sn);

               trackToPlay = list.selectedItem.songString; // Define New track to play

               Statu_txt. text+ list.selectedItems. Label +"mp3"

               gotoAndPlay(2); /// Make the switch and play

           }

              // Always set pausePosition back to 0 here

              pausePosition = 0;}

      /// Close newTrack function

      ////////////////////////////////////////////////////////////////////////////////////

      addEventListener(Event.ENTER_FRAME,onEnterFrame);

      function onEnterFrame(event:Event):void{

          ///////animatedEQ bars

          eqbarleft1.gotoAndStop(Math.round(channel.leftPeak* 9));///amount of frames in eq

          eqbarright1.gotoAndStop(Math.round(channel.rightPeak* 9));

          eqbarleft2.gotoAndStop(Math.round(channel.leftPeak* 7));

          eqbarleft3.gotoAndStop(Math.round(channel.leftPeak* 5));

          eqbarleft4.gotoAndStop(Math.round(channel.leftPeak* 9));

          eqbarright2.gotoAndStop(Math.round(channel.rightPeak* 5));

          eqbarright3.gotoAndStop(Math.round(channel.rightPeak* 7));

          eqbarright4.gotoAndStop(Math.round(channel.rightPeak* 9));

          ///

           var volumeLevel = channel.soundTransform;

          var newLevel:Number=(volumeSliderknobx)/-100

          volumeLevel.volume=newLevel;

          channel.soundTransform= volumeLevel;

          volumeSlider.volumeLightBar.width=volumeSlider.knobx

       

      }