dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: handling multiple sounds

  1. #1
    Junior Member
    Join Date
    Apr 2006
    Posts
    19

    handling multiple sounds

    i am playing multiples sounds at a time .when i try to reduce the volume of one of sound it effect volume of all sounds. and also if i try to stop one of sound it stop all of sounds.how can i handle any specific sound.

    StartSound();
    function StartSound()
    {
    mysound=new Sound();
    mysound.attachSound("s1");
    mysound.start(0,1000);
    mysound.setVolume(100);

    mysound2=new Sound();
    mysound2.attachSound("s2");
    mysound2.start(0,1000);
    mysound2.setVolume(50);
    }

    function stopSound()
    {
    mysound3=new Sound();
    mysound3.attachSound("s1");
    mysound3.stop();
    }

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    place the sounds inside of different movieclips:

    _root.createEmptyMovieClip("s1", _root.getNextHighestDepth());
    mysound=new Sound(s1);
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #3
    Member
    Join Date
    Aug 2007
    Posts
    38

    Controlling Volume for Multiple Sounds: not working

    I'm working in ActionScript 2.0 if that makes any difference.
    I've tried this movie clip idea, and each control still affects all sounds.

    In movie clip "music_mc" I have:

    mySound1_sound = new Sound();
    mySound1_sound.attachSound("music");
    mySound1_sound.start(0,15);
    mySound1_sound.setVolume(0);

    In the other, "music2_mc":

    mySound2_sound = new Sound();
    mySound2_sound.attachSound("music2");
    mySound2_sound.start(0,15);
    mySound2_sound.setVolume(0);

    I have 2 buttons in the main timeline:

    music_btn.onRelease = function() {
    _root.music_mc.mySound1_sound.setVolume(100); }

    music2_btn.onRelease = function() {
    _root.music2_mc.mySound2_sound.setVolume(100); }

    When I press either button, the volume for both sounds changes to 100.

    I've seen people with this same problem at lot out there, but have yet to find a way to fix it. If you don't know a definite solution, even vague ideas of things to try would be much appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center