this is using loadSound, where you can place the mp3 outside of your movie, and it will load stream it, change loadSound() to attachSound() if you want it to remain in the library...
ActionScript Code:
this.createEmptyMovieClip("sound_mc", 10);
music = new Sound(sound_mc);
music.loadSound("test.mp3", true);
music.start();
active_button = "play";
// pause button
pause_button_mc.onRelease = function() {
if (active_button == "play") {
pause_resume = music.position;
music.stop();
active_button = "pause";
}
}
pause_button_mc.onRollOver = function() {
this._alpha = 50;
}
pause_button_mc.onRollOut = function() {
this._alpha = 100;
}
// play button
play_button_mc.onRelease = function() {
if (active_button == "pause") {
music.start(pause_resume / 1000);
active_button = "play";
}
}
play_button_mc.onRollOver = function() {
this._alpha = 50;
}
play_button_mc.onRollOut = function() {
this._alpha = 100;
}
be sure that you are using movieclips, not true "flash buttons" for the buttons, in this case.... just convert your button to a movieclip symbol, and give it an instance name of play_button_mc, and pause_button_mc...
also, make a new layer on the root (main) timeline, and place all this code in an empty keyframe...
hope this helps...
cheers
j