A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: multiple sound volume control

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    2

    multiple sound volume control

    i'm having trouble trying to control the volume of multiple sounds in my animation. the volume is meant to change based on the position of the mouse relative to a particular object moving on the screen. each sound is connected to a different object, and so needs to vary independently.

    i'm using a Sound1.setVolume(volume1); command, but the volume is changing for all of the sounds together.

    any advice?

    I see that my question is probably answered in the common problems section, unfortunately i don't quite understand the explanation. the uniquesound to mc? can anyone elaborate on this?

    thank you,
    Last edited by kfor; 03-16-2008 at 07:13 PM.

  2. #2
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    if you create a sound object with nothing inside the Sound() function parenthesis, then the sound object will control volume of all sounds.

    instead you create a sound object and pass the target path of a unique movie clip to the Sound() function.

    // create a movie clip
    var snd1mc:MovieClip = this.createEmptyMovieClip("snd1mc",this.getNextHig hestDepth());
    var Sound1:Sound = new Sound(snd1mc); // pass it to the sound function

  3. #3
    Junior Member
    Join Date
    Mar 2008
    Posts
    2
    thank you, finally got it to work,

  4. #4
    Flash Genie letschillout's Avatar
    Join Date
    Feb 2007
    Location
    31.52949, 74.347272
    Posts
    146
    Thanks for the post i also got ur help
    Charag - 3D, Flash Games, Animations,
    Website Development & More...


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