este es el código que tengo:
Cita:
De antemano muchas gracias (: var mcPath:MovieClip = this;
var timer:Number = 0;
var wTime:Number = mcTime._width;
var music:Sound = new Sound();
music.loadSound("sound.mp3", false);
music.onLoad = function() {
startProgress();
btPlay.enabled = true;
}
music.onSoundComplete = function() {
timer = 0;
btPlay._visible = true;
stopProgress();
}
function startProgress() {
delete mcPath.onEnterFrame;
mcPath.onEnterFrame = function() {
txtTime.text = "TIME: "+music.position+" / "+music.duration;
mcTime._width = wTime*(music.position/music.duration);
}
}
function stopProgress() {
delete mcPath.onEnterFrame;
}
btPlay.enabled = false;
btPlay.onRelease = function() {
music.start(timer/1000);
startProgress();
btPlay._visible = false;
}
btPause.onRelease = function() {
timer = music.position;
music.stop()
stopProgress();
btPlay._visible = true;
}
var timer:Number = 0;
var wTime:Number = mcTime._width;
var music:Sound = new Sound();
music.loadSound("sound.mp3", false);
music.onLoad = function() {
startProgress();
btPlay.enabled = true;
}
music.onSoundComplete = function() {
timer = 0;
btPlay._visible = true;
stopProgress();
}
function startProgress() {
delete mcPath.onEnterFrame;
mcPath.onEnterFrame = function() {
txtTime.text = "TIME: "+music.position+" / "+music.duration;
mcTime._width = wTime*(music.position/music.duration);
}
}
function stopProgress() {
delete mcPath.onEnterFrame;
}
btPlay.enabled = false;
btPlay.onRelease = function() {
music.start(timer/1000);
startProgress();
btPlay._visible = false;
}
btPause.onRelease = function() {
timer = music.position;
music.stop()
stopProgress();
btPlay._visible = true;
}