Hi all, I did a search and looked at tons of threads including Voetsjoba mp3 player.
This is way more complicated than what i need / want. i already have an mp3 player I’ve built that uses dynamic text (song title and track info) and variables to load an mp3 dynamically through .php & FlashVars. I only need 1 mp3 playing at one time and so this method works great for me. This way I can update it without going into Flash at all (but XML is overkill so no need for that either).
Thing is, I would like to have a play and stop button that actually stops and starts the track where it last was stopped / paused, rather than resuming from the beginning.
I also have built in a volume slider.
Here is the Actionscript I’ve been using:
ON VOLUME SLIDER MC [mySlider]:
onClipEvent (load) {
mySound = new Sound();
mySound.loadSound(mp3Title,true);
}
onClipEvent (enterFrame) {
mySound.setVolume(_root.volume);
}
ON PLAY BUTTON:
on (release) {
_root.mySlider.mySound.start();
}
ON STOP (PAUSE) BUTTON:
on (release) {
_root.mySlider.mySound.stop();
}
ON DRAGGER INSIDE VOLUME SLIDER MC:
this.ratio = 0;
dragger.onPress = function() {
this.startDrag(true, 0, 0, line._width, 0);
this.onEnterFrame = function() {
ratio = Math.round(this._x*100/line._width);
_root.volume = ratio;
};
};
dragger.onRelease = dragger.onreleaseOutside=stopDrag;
works ok, but like i said…stop does not “pause” the mp3 but rather stops it irrecoverably.
play starts from the beginning which I would like to avoid.
thanks in advance.