Last active
August 29, 2015 14:17
-
-
Save jamieshepherd/7e21084abbe1a41d27c1 to your computer and use it in GitHub Desktop.
Fade music Flash AS2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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