Be a Supporter!

Edits to post #25309976 by SkyTheStarHero

Back to Music Effect Help

Edited at 2014-11-25 16:45:56

At 11/18/14 07:02 AM, Gimmick wrote: You could lower the sound volume in the movie to 0 and then later set it back to 100. Since you're using Flash 8 you're using AS2, so it'd be something like this (haven't really tested it but I think this'll work):

//create some sound object
var snd:Sound = new Sound(some_movieclip)
var vol:Number = 0
function fadeVol()
{
snd.setVolume(--vol)
if(vol < 0)
{
onEnterFrame = null
vol = 100
}
}
button.onPress = function()
{
onEnterFrame = fadeVol
}

Man, thank you so much for even replying! You're awesome! Do I put this in the same frame with the text box?


At 11/18/14 07:02 AM, Gimmick wrote: You could lower the sound volume in the movie to 0 and then later set it back to 100. Since you're using Flash 8 you're using AS2, so it'd be something like this (haven't really tested it but I think this'll work):

//create some sound object
var snd:Sound = new Sound(some_movieclip)
var vol:Number = 0
function fadeVol()
{
snd.setVolume(--vol)
if(vol < 0)
{
onEnterFrame = null
vol = 100
}
}
button.onPress = function()
{
onEnterFrame = fadeVol
}

Man, thank you so much for even replying! You're awesome! Though I just put it in the flash, and I placed it in the same frame as the script for stopping the frame for a textbox. Nothing really happened.. Do I put it in a different frame in the timeline? Or do I put it in the same frame as the script for stopping the animation for pressing space on the text box? Here's the action script for it by the way.

stop();
onEnterFrame = function () {
if (!Key.isDown(Key.SPACE)) {
_root.allow = true;
} else if (Key.isDown(Key.SPACE) && _root.allow == true) {
play();
_root.allow = false;
}
};