Well. The way I do fades is like this. On the first frame, I have this:
_root.s = new Sound();
_root.s.attachSound("atb"); //I don't actually use linkage in the library, though
_root.s.setVolume(80);
Then, to raise or lower the volume
_root.s.setVolume(_root.s.getVolume()+10);
_root.s.setVolume(_root.s.getVolume()-10);
You can put these on buttons or add them to a loop if you want to fade out, eg
onClipEvent(enterFrame){
_root.s.setVolume(_root.s.getVolume()-1);
if(_root.s.getVolume()==0){_root.s.setVolume(0);}
}
Play around with that. Also have a look at AS: Sound
At 5/26/05 07:06 AM, Imperium_Macabre wrote: Ok what I got was
Clip events are permitted only for movie clip instances
^there's your answer. The code I gave you won't work on buttons
OK, so you want to use a button to fade the music.
Create a new (empty) MC and add it to the stage along with your button(s)
Select it, and add these actions:
onClipEvent(load){_root.vchange=0;}
onClipEvent(enterFrame){
if(_root.vchange==1){_root.s.setVolume(_root.s.getVolume()-1);}
else if(_root.vchange==2){_root.s.setVolume(_root.s.getVolume()+1);}
if(_root.s.getVolume==0||_root.s.getVolume==100){_root.vchange=0;}
}
then add this to your fade out button:
on(press){_root.vchange=1;}
And on your fade in button
on(press){_root.vchange=2;}
At 5/26/05 06:59 AM, Denvish wrote: _root.s = new Sound();
_root.s.attachSound("atb"); //I don't actually use linkage in the library, though
_root.s.setVolume(80);
Then, to raise or lower the volume
_root.s.setVolume(_root.s.getVolume()+10);
_root.s.setVolume(_root.s.getVolume()-10);
all i wanna do is make the bgm volume lower at a certain point in the movie, so i put the first script in the frame the music started and the second where i wanted it to lower, and it didn't work. what am i doing wrong? the name of the sound is Death BGM, and this is my script.
_root.s = new Sound();
_root.s.attachSound("Death BGM");
_root.s.setVolume(80);
------------------------------------------
------------------------------------------
---
_root.s.setVolume(_root.s.getVolume()+10);
_root.s.setVolume(_root.s.getVolume()-10);
[RE Club]:[SSB Crew]:[Free Hentai Exchange Club]
Want animated Signature Pics back? Copy this Sig Pic as protest!
At 9/8/05 05:14 PM, DevilsSin666X wrote: all i wanna do is make the bgm volume lower at a certain point in the movie, so i put the first script in the frame the music started and the second where i wanted it to lower, and it didn't work. what am i doing wrong? the name of the sound is Death BGM, and this is my script.
_root.s = new Sound();
_root.s.attachSound("Death BGM");
_root.s.setVolume(80);
Firstly, make sure you're using the linkeage name, not the Instance Name or the soundfile name - right-click the sound in the Library and select 'linkeage' to check/change it.
Secondly, try removing the space from 'Death BGM', ie use 'DeathBGM' both in the linkeage name, and the code. I don't know if spaces in linkeage names can cause problem, but it's something obvious that is worth eliminating as a problem.
At 9/8/05 05:19 PM, Denvish wrote: Firstly, make sure you're using the linkeage name, not the Instance Name or the soundfile name - right-click the sound in the Library and select 'linkeage' to check/change it.
Secondly, try removing the space from 'Death BGM', ie use 'DeathBGM' both in the linkeage name, and the code. I don't know if spaces in linkeage names can cause problem, but it's something obvious that is worth eliminating as a problem.
when i hit linkage, i get 2 textboxs: identifyer and AS 2.0 class. which one do i type DeathBGM into?
[RE Club]:[SSB Crew]:[Free Hentai Exchange Club]
Want animated Signature Pics back? Copy this Sig Pic as protest!