0 Replies Latest reply on Jan 22, 2007 2:49 PM by wiredsc1

    MP3 player buttons query

    wiredsc1
      Okay, I'm not a big fan of frames, but I'm using frames on a page I'm doing so that I can have an mp3 player in the top frame. I've used the mp3 player before, on it's own in a seperate window though, but using it in a frame isn't working.

      Firstly, this doesn't play mp3's as such,but .swf's so I can have animations with them.
      Also when i say the buttons are not working, to be specific, the first track is loading fine, however when I try to skip forward or back the track stops, but nothing else. The same happens when I try to skip the track back to the beginning.

      When I try to pause/stop the track, nothing happens at all.

      The frame the player is in is called _tasc2.

      This is the script I have at the moment.



      Script for player:

      this.createEmptyMovieClip("tascband", 10);
      var i = random(5)+1;
      tascband.loadMovie("tunes/track"+(i)+".swf");
      loadF(tascband);
      function loadF(mc){
      preloadI=setInterval(preloadF,100,mc);
      streaming._visible = true;
      //_root.createTextField("tf",1,0,0,100,30); // position where you want
      //_root.tf.text="streaming"; // it's not really streaming. it's loading
      }
      function preloadF(mc){
      if(mc.getBytesLoaded()>0&&mc.getBytesLoaded()>=mc.getBytesTotal()){
      clearInterval(preloadI);
      streaming._visible = false;
      //_root.tf.removeTextField();
      }
      }

      Tasc = new Sound(this);
      Tasc.start();
      slider.control._y = -50;
      slider.control.onEnterFrame = function() {
      Tasc.setVolume(0-this._y);
      };
      slider.control.onPress = function() {
      startDrag(this, false, this._x, -100, this._x, 0);
      };
      slider.control.onRelease = slider.control.onReleaseOutside=function () {
      stopDrag();
      };
      stop();






      Script for 'Pause/Play' button:

      on (release) {
      _root.tascband.play();
      }






      Script for 'stop' button:

      on (release) {
      _root.tascband.stop();
      tellTarget("tascband") {
      stop();
      }
      }






      script for 'rewind' button:

      on (release) {
      i;
      mov_to_load = "tunes/track"+i+".swf";
      if (tascband._visible=("track.swf", true)) {
      stopAllSounds();
      tascband.loadMovie(mov_to_load);
      }
      }






      script for 'skip back' button:

      on (release) {
      i--;
      if (i<1) {
      i = 5;
      }
      mov_to_load = "tunes/track"+i+".swf";
      if (tascband._visible=("track.swf", true)) {
      stopAllSounds();
      tascband.loadMovie(mov_to_load);
      loadF(tascband);
      }
      }






      Script for 'skip forward' button:

      on (release) {
      i++;
      if (i>5) {
      i = 1;
      }
      mov_to_load = "tunes/track"+i+".swf";
      if (tascband._visible=("track.swf", true)) {
      stopAllSounds();
      tascband.loadMovie(mov_to_load);
      loadF(tascband);
      }
      }


      This is how I scripted the player when I originally did it for when it was in it's only window. I have made some changes for it to go in a frame, but it's not worked yet so I won't post it, to keep things simple.

      If anyone has any idea, then I would really appreciate it. I'm assuming it is to do with _root or something, just can't get my head around it at this point.

      Thanks in advance