Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Hi i need help with my mp3 flash player

New Here ,
Dec 03, 2013 Dec 03, 2013

Hi i need help with my mp3 player, i wan't to add pause button..can you help me?

i created button i added btn_pause and it won't work.

function soundStatus(){

          var amountLoaded = _root.sound_mc.sound_obj.getBytesLoaded() / _root.sound_mc.sound_obj.getBytesTotal();

          _root.loader.loadBar._width = amountLoaded * 260;

          duration = _root.sound_mc.sound_obj.duration;

          position = _root.sound_mc.sound_obj.position;

          _root.playHead._x = position / duration * 272 + 5;

}

btn_play.onRelease = function() {

          clearInterval(timeInterval);

          _root.timeDisplay_txt.text = "00:00/00:00";

          this._parent.sound_mc.songStarter(songfile[song_nr]);

};

btn_pause.onRelease = function() {

          clearInterval(timeInterval);

          _root.timeDisplay_txt.text = "00:00/00:00";

          this._parent.sound_mc.sound_obj.pause();

};

btn_stop.onRelease = function() {

          clearInterval(timeInterval);

          _root.timeDisplay_txt.text = "00:00/00:00";

          this._parent.sound_mc.sound_obj.stop();

};

btn_fw.onRelease = function() {

          clearInterval(timeInterval);

          _root.timeDisplay_txt.text = "00:00/00:00";

          (song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;

          _root.sound_mc.songStarter(songfile[song_nr]);

};

btn_rev.onRelease = function() {

          clearInterval(timeInterval);

          _root.timeDisplay_txt.text = "00:00/00:00";

          (song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;

          _root.sound_mc.songStarter(songfile[song_nr]);

};

<moved by mod from as3 - kglad>

TOPICS
ActionScript
417
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 03, 2013 Dec 03, 2013
:

function soundStatus(){

          var amountLoaded = _root.sound_mc.sound_obj.getBytesLoaded() / _root.sound_mc.sound_obj.getBytesTotal();

          _root.loader.loadBar._width = amountLoaded * 260;

          duration = _root.sound_mc.sound_obj.duration;

          position = _root.sound_mc.sound_obj.position;

          _root.playHead._x = position / duration * 272 + 5;

}

btn_play.onRelease = function() {

          clearInterval(timeInterval);

          _root.timeDisplay_txt.text = "00:00/00:00";

        

...
Translate
Community Expert ,
Dec 03, 2013 Dec 03, 2013
LATEST
:

function soundStatus(){

          var amountLoaded = _root.sound_mc.sound_obj.getBytesLoaded() / _root.sound_mc.sound_obj.getBytesTotal();

          _root.loader.loadBar._width = amountLoaded * 260;

          duration = _root.sound_mc.sound_obj.duration;

          position = _root.sound_mc.sound_obj.position;

          _root.playHead._x = position / duration * 272 + 5;

}

btn_play.onRelease = function() {

          clearInterval(timeInterval);

          _root.timeDisplay_txt.text = "00:00/00:00";

          this._parent.sound_mc.songStarter(songfile[song_nr]);

};

btn_pause.onRelease = function() {

          clearInterval(timeInterval);  // you should re-set this interval when the unpause button is clicked

         // _root.timeDisplay_txt.text = "00:00/00:00";

          this._parent.sound_mc.sound_obj.stop()

};

btn_unpause.onRelease=function(){

this._parent.sound_mc.sound_obj.start(position/1000);

}

btn_stop.onRelease = function() {

          clearInterval(timeInterval);

          _root.timeDisplay_txt.text = "00:00/00:00";

          this._parent.sound_mc.sound_obj.stop();

};

btn_fw.onRelease = function() {

          clearInterval(timeInterval);

          _root.timeDisplay_txt.text = "00:00/00:00";

          (song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;

          _root.sound_mc.songStarter(songfile[song_nr]);

};

btn_rev.onRelease = function() {

          clearInterval(timeInterval);

          _root.timeDisplay_txt.text = "00:00/00:00";

          (song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;

          _root.sound_mc.songStarter(songfile[song_nr]);

};

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines