00:00
00:00
Newgrounds Background Image Theme

Mekatov just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Sound 2005-05-26 06:45:06


What's the script to stop all sounds?

Response to Sound 2005-05-26 06:47:02


stopAllSounds();


- - Flash - Music - Images - -

BBS Signature

Response to Sound 2005-05-26 06:50:09


Hm.. How about making the sound fade out with that script? Is that possible?

Response to Sound 2005-05-26 06:59:06


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


- - Flash - Music - Images - -

BBS Signature

Response to Sound 2005-05-26 07:00:34


Thanks alot

Response to Sound 2005-05-26 07:06:49


Ok what I got was

Clip events are permitted only for movie clip instances

What's gone wrong here? I entered this into the button

onClipEvent(enterFrame){
_root.s.setVolume(_root.s.getVolume()-1);
if(_root.s.getVolume()==0){_root.s.setVolume(0);}
}

Response to Sound 2005-05-26 07:26:47


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;}


- - Flash - Music - Images - -

BBS Signature

Response to Sound 2005-05-26 07:29:50


stopAllSounds();

Response to Sound 2005-05-26 07:41:30


At 5/26/05 07:29 AM, waru wrote: stopAllSounds();

Try reading the WHOLE THREAD before posting.


- - Flash - Music - Images - -

BBS Signature

Response to Sound 2005-05-29 05:30:00


i still dont understand it wont work could u please tell me again but easier to understand.

Response to Sound 2005-06-09 06:10:07


Please can someone post the correct code that works this one dosnt work

Response to Sound 2005-06-09 06:29:24


The code itself works perefectly,maybe it doesn't work beause you touch yourself at night!


BBS Signature

Response to Sound 2005-09-08 17:14:06


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!

BBS Signature

Response to Sound 2005-09-08 17:19:33


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.


- - Flash - Music - Images - -

BBS Signature

Response to Sound 2005-09-08 17:37:49


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!

BBS Signature

Response to Sound 2007-02-03 12:12:49


At 9/8/05 05:37 PM, DevilsSin666X wrote: when i hit linkage, i get 2 textboxs: identifyer and AS 2.0 class. which one do i type DeathBGM into?

Type DeathBGM into the Indentifier box.