A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: separate volume control

  1. #1
    Senior Member
    Join Date
    Aug 2000
    Location
    Central PA
    Posts
    120

    separate volume control

    What I need to do is to show the difference between what we hear and what an unborn baby might hear while the mother reads a book. I need to start off with the mother's reading, then with a button click muffle the reading and hear the squishy body sounds with heartbeat (I have that as a separate sound file). So I made 2 sound objects:

    var playing = false;

    readingSnd = new Sound();
    readingSnd.attachSound("reading");

    bodySnd = new Sound();
    bodySnd.attachSound("body");

    readingSnd.start(0,999);


    Linkage is set in the library for both sounds.

    Here is the code for the button:

    on (release) {
    if (playing!=true) {
    bodySnd.start(0,999);
    readingSnd.setVolume(5);
    playing=true;
    }
    }


    My problem is that when I set readingSnd volume low, they're both low. If I set the volume for the bodySnd to 100 so it's more prominent than the readingSnd, then they're both full volume. I can't seem to separate the 2 sound volumes. Other than making a premixed version of the combined reading/body sound is it possible to separately control the 2 volumes, or does setVolume only control the computer's sound output?
    ?:-{>

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Location
    Central PA
    Posts
    120
    The pan example on that tutorial doesn't seem to work right. When I click a sound, then click the pan control, the button disappears and i can't do anything else with it. Can't use any of the buttons to stop/start the sounds. I have the latest Flash player and am running it on a new Mac laptop in Safari.
    ?:-{>

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Central PA
    Posts
    120
    It's working now. I did as the tutorial said and created empty movies and associated the sound objects with each. It will now play the reading low and the body sounds louder.

    Here is my code after adding an empty movie called MCreading and MCbody:

    var playing = false;

    readingSnd = new Sound(MCreading);
    readingSnd.attachSound("reading");

    readingSnd.start(0,0);

    bodySnd = new Sound(MCbody);
    bodySnd.attachSound("body");

    Thanks for the help!
    ?:-{>

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