Skip to content

Instantly share code, notes, and snippets.

@jamieshepherd
Last active August 29, 2015 14:17
Show Gist options
  • Save jamieshepherd/7e21084abbe1a41d27c1 to your computer and use it in GitHub Desktop.
Save jamieshepherd/7e21084abbe1a41d27c1 to your computer and use it in GitHub Desktop.
Fade music Flash AS2
// Fade music
function fadeMusic(newVolume){
Tweener.addTween(this,{audioVolume:newVolume, time:3, delay:0, transition:"easeOutSine"});
this.onEnterFrame = function(){
backgroundMusic.setVolume(Math.round(audioVolume));
if(audioVolume==newVolume){
delete this.onEnterFrame
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment