Be a Supporter!
Dead-Man-Inc
Dead-Man-Inc
  • Member since: Jul. 28, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Sound May. 26th, 2005 @ 06:45 AM Reply

What's the script to stop all sounds?

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Sound May. 26th, 2005 @ 06:47 AM Reply

stopAllSounds();


- - Flash - Music - Images - -

BBS Signature
Dead-Man-Inc
Dead-Man-Inc
  • Member since: Jul. 28, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Sound May. 26th, 2005 @ 06:50 AM Reply

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

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Sound May. 26th, 2005 @ 06:59 AM Reply

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
Dead-Man-Inc
Dead-Man-Inc
  • Member since: Jul. 28, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Sound May. 26th, 2005 @ 07:00 AM Reply

Thanks alot

Dead-Man-Inc
Dead-Man-Inc
  • Member since: Jul. 28, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Sound May. 26th, 2005 @ 07:06 AM Reply

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

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Sound May. 26th, 2005 @ 07:26 AM Reply

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
waru
waru
  • Member since: May. 23, 2005
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Sound May. 26th, 2005 @ 07:29 AM Reply

stopAllSounds();

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Sound May. 26th, 2005 @ 07:41 AM Reply

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

Try reading the WHOLE THREAD before posting.


- - Flash - Music - Images - -

BBS Signature
magicalmouse
magicalmouse
  • Member since: Oct. 26, 2004
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Sound May. 29th, 2005 @ 05:30 AM Reply

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

magicalmouse
magicalmouse
  • Member since: Oct. 26, 2004
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Sound Jun. 9th, 2005 @ 06:10 AM Reply

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

Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Sound Jun. 9th, 2005 @ 06:29 AM Reply

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


BBS Signature
DevilsSin666X
DevilsSin666X
  • Member since: Sep. 3, 2004
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Sound Sep. 8th, 2005 @ 05:14 PM Reply

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
Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Sound Sep. 8th, 2005 @ 05:19 PM Reply

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
DevilsSin666X
DevilsSin666X
  • Member since: Sep. 3, 2004
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Sound Sep. 8th, 2005 @ 05:37 PM Reply

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
UnknownFear
UnknownFear
  • Member since: Feb. 27, 2004
  • Offline.
Forum Stats
Member
Level 37
Gamer
Response to Sound Feb. 3rd, 2007 @ 12:12 PM Reply

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.