musik skal fade ud
Hey flash guruer.Jeg har noget musik til at spille i min film, men så på et tidspunkt så kommer der et filmklip der skal afspilles.
Når det begynder så skal den musik der spiller fades ud, og når film klippet er færdigt skal musikken fade ind igen.
I min Soundplayer har jeg i frame i :
// Title and Time (CHANGE HERE)
title = "DustDevils";
trackLength = "04:05";
// Loading sound and playhead functions
s = new Sound();
src = "sound/DustDevils.mp3";
s.loadSound(src, true);
s.onLoad = function() {
info = "Song has loaded";
gotoAndPlay("playing");
};
s.onSoundComplete = function() {
info = "Song complete";
gotoAndStop("finished");
};
-----------
i Frame 10:
// Track info
song_title = "Now playing: "+title;
// Total Loading time
total_time = "Total time: "+t_time.total+" of "+trackLength;
// Checking time download
if (t_time.total == trackLength) {
total_time = "Total time: "+t_time.total;
}
// Elapsed Loading time
elapsed_time = "Elapsed time: "+e_time.total;
// Set bar properties
playbar.duration_bar._width = _global.dur;
playbar.position_bar._width = _global.pos;
playbar._width = 100;
// Timer function
onEnterFrame = function () {
_global.dur = int(s.duration/1000);
_global.pos = int(s.position/1000);
t_time = {};
t_time.minutes = int(_global.dur/60);
t_time.seconds = int(_global.dur%60);
t_time.total = displayTime(t_time.minutes)+":"+displayTime(t_time.seconds);
e_time = {};
e_time.minutes = int((_global.pos)/60);
e_time.seconds = int((_global.pos)%60);
e_time.total = displayTime(e_time.minutes)+":"+displayTime(e_time.seconds);
};
// Time display
function displayTime(digit) {
return (digit<10) ? digit="0"+digit : digit;
}
------------------------------------------------------
Håber det giver mening
