hi all i have cd to introduce six songs
what will be the code if i want on muse over on any picture of the songs album the sound will start with fade in effect
and on mouse out the sound fade out and stop ??
Printable View
hi all i have cd to introduce six songs
what will be the code if i want on muse over on any picture of the songs album the sound will start with fade in effect
and on mouse out the sound fade out and stop ??
you need to use a Sound Object.
see - How to Fade a Sound Object Up or Down
http://www.kennybellew.com/tutorial/
thx a lot for u i will visit it now
thx and i found a pgae to do something near what i want but when i try to edit the code i did not success
this is the page if any one can help
what i want is one button on mouse over then the sound will start fade in and if mouse out then it will fade out
thx
http://www.kennybellew.com/tutorial/fade.htm
hope this helps :DPHP Code:/*
import your mp3 to the Library, give it a Linkage Identifier - myMP3
add a button to the stage - give it an instance name - fadeBtn
add this code to the main timeline, (same frame as the button)
*/
this.createEmptyMovieClip("clip",1000);
mySound = new Sound(clip);
mySound.attachSound("myMP3");
this.createEmptyMovieClip("FADEin",2000);
this.createEmptyMovieClip("FADEout",3000);
vol = 0;
inc = 0.5;
inc2 = 1;
songPlay = false;
function fadeIn(){
FADEout.onEnterFrame = null;
mySound.setVolume(0);
if(!songPlay) {
mySound.start();
songPlay = true;
}
FADEin.onEnterFrame = function(){
trace("fade in volume - "+vol)
vol>100 ? vol=100 : vol+=inc;
vol==100 ? FADEin.onEnterFrame = null : null;
mySound.setVolume(vol)
}
};
function fadeOut(){
FADEin.onEnterFrame = null;
FADEout.onEnterFrame = function(){
trace("fade out volume - "+vol)
vol<0 ? vol=0 : vol-=inc2;
mySound.setVolume(vol);
if(vol==0){
FADEout.onEnterFrame = null;
mySound.stop();
songPlay = false;
}
}
};
fadeBtn.onRollOver = function(){
fadeIn();
};
fadeBtn.onRollOut = function(){
fadeOut();
};