Flash Q
- Started
- Last post
- 2 Responses
- abizzyman
I'm trying to build a function that targets a specific clip's attached sound.
I want the sound to go down for one function in increments of 5 and stop if below 0.
I want the exact opposite if the sound is at zero....
... so I'm thinking that it's two funtions... right?
bah... I'm hung up though - I attach the sounds to a clip using onClipEvent (load){
bob = new Sound(this);
bob.attachSound("clip.wav");
bob.setVolume(0);
bob.start();so... I start the sound but at zero... then with the press of a button... I want to target that sound w/a function (or a prototype) that just tweaks the volume.
help?
- Mick0
var vol:Number = 0;
var pan:String = "up";FadeSound = function(pan){
trace("fading");
if(pan=="up" && vol0){
vol--;
} else {
clearInterval(soundInterval);
trace("finished fading");
}
mc.bob.setVolume(vol);
}butup.onRelease = function(){
soundInterval = setInterval(FadeSound,20,"up");
}
butdown.onRelease = function(){
soundInterval = setInterval(FadeSound,20,"down...
}
- Mick0
some greaterthan and lessthan symbols in there went bye byes ;)