The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.36 / 5.00 33,851 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 12,195 ViewsSo I have a movieclip that has two movieclips nested in it.
The first movieclip plays once, then the second one will loop infinitely.
When someone presses the play button, I want the sound volume to decrease no matter where or which song is playing. How can I do this?
I was thinking something like this:
(I know setVolume might not even exist, just a gist of what I want)
onEnterFrame=function(){
button.onRelease(){
setVolume(100);
volume -=3;
if(volume == 0){nextFrame}}} No matter what your weaknesses are, make sure your own abilities supersede them.
You have the right idea but after importing the sound to library you want to right-click your sound in the library and select linkage.
Click "Export for Actionscript" and "Export in First Frame" and then in the identifier box put "song1".
Then in the frames action panel put:
level=100;
clicked=false
newSound=new Sound(this);
newSound.attachSound("song1");
newSound.start(0,99);
onEnterFrame=function()
{
newSound.setVolume(level);
if(clicked==true&&level>=0)
{
level-=3;
}
}
button.onRelease=function()
{
clicked=true;
}
You might have adjust this code a little since you used nested movieclips.
:'(
I should add that for your particular problem you should incorporate a for loop to account for multiple songs.
Just give each song and identifier of "song1","song2" etc..
for(i=0;i<10;i++)
{
newSound=new Sound(this);
newSound.attachSound(["song"+i]);
}
You also must specify which song actually playing at which time with:
newSound.attachSound("song1"); :'(
Problem is, that I can't use actionscript to loop the songs because there gap between the song looping doesn't give the effect I want.
No matter what your weaknesses are, make sure your own abilities supersede them.