Hi,
Ok then, I will guide you through it.
On the main timeline place this code
PHP Code:
var TheWidth = 200;
PlayTime.text = "00:00";
FullTime.text = "00:00";
on your play button remove the code and put this code
PHP Code:
on (release) {
trilha = new Sound();
som = "Test.mp3";
trilha.loadSound(som,true);
Played = true;
}
on AreaS movieclip, remove all code and replace with this code
PHP Code:
onClipEvent (load) {
scroller._x = 0;
playbar._width = 0;
loadbar._width = 0;
}
onClipEvent (enterFrame) {
if (_parent.Played == true)
{
// *** Total Time
var TotalTime = Math.floor(_parent.trilha.duration / 1000);
var TotalMin = Math.floor(TotalTime / 60);
var TotalSec = Math.floor(TotalTime) % 60;
if (TotalMin < 10)
{
TotalMin = "0" + TotalMin;
}
if (TotalSec < 10)
{
TotalSec = "0" + TotalSec;
}
_parent.FullTime.text = TotalMin + ":" + TotalSec;
// *** Playing Time
var PlayingTime = _parent.trilha.position / 1000;
var PlayMin = Math.floor(PlayingTime / 60);
var PlaySec = Math.floor(PlayingTime) % 60;
if (PlayMin < 10)
{
PlayMin = "0" + PlayMin;
}
if (PlaySec < 10)
{
PlaySec = "0" + PlaySec;
}
_parent.PlayTime.text = PlayMin + ":" + PlaySec;
// *** Loadbar fill
var NowLoading = _parent.trilha.getBytesLoaded() / 1000;
var NowComplete = _parent.trilha.getBytesTotal() / 1000;
var NowLoaded = Math.round((NowLoading / NowComplete) * _parent.TheWidth);
loadbar._width = NowLoaded;
// *** Playbar movement
var playpos = Math.floor((_parent.TheWidth * _parent.trilha.position) / _parent.trilha.duration);
playbar._width = playpos;
// *** Scrollbar
scroller._x = playbar._x + playbar._width;
scroller.onPress = function()
{
scroller.onEnterFrame = function()
{
startDrag(this, true, 0, 0, _parent.TheWidth, 0);
_parent.trilha.stop();
};
};
scroller.onRelease = scroller.onReleaseOutside = function ()
{
stopDrag();
delete scroller.onEnterFrame;
var duration = Math.floor(_parent.trilha.duration / 1000);
var cue = Math.floor((scroller._x * duration) / _parent.TheWidth);
_parent.trilha.start(cue);
};
// *** Song finishes
_parent.trilha.onSoundComplete = function()
{
scroller._x = 0;
playbar._width = 0;
loadbar._width = 0;
_parent.Played = false;
_parent.trilha.stop();
_parent.PlayTime.text = "00:00";
_parent.FullTime.text = "00:00";
};
}
}
place on the stage two textfields
one named FullTime
the other named PlayTime
you can delete the empty movieclip from the stage
or perhaps somebody would be kind enough to make it flash 8 compatible for you
good luck