2 Replies Latest reply on Jan 10, 2008 5:57 AM by prtrb

    setVolume doesn't seem to work with loadSound

      I've been using Flash and the sound object extensively since v5 so this problem came as a huge surprise to me... I don't think I've ever encountered it before.

      I'm trying to send setVolume() commands to a sound object that is associated with an MP3 via loadSound(). I've tried streaming and non-streaming approaches with loadSound() and get the same results -- any changes applied to the sound object with setVolume are completely ignored.

      I can use the same code, replace loadSound with attachSound and everything works as expected (with sounds in the Library). However, with external MP3s and loadSound, the volume level defaults and cannot be changed. When I trace(getVolume()) it reports values between 0-100 so I know that aspect of the code is right.

      Am I missing something or is this just a task that can't be done with sounds that have been loaded from outside the SWF?
        • 1. Re: setVolume doesn't seem to work with loadSound
          clbeech Level 3
          it may be that you have more than one sound in your file? and you have used setVolume() elsewhere on a different Sound Object and perhaps did not specify a scope in the constructor. just a thought :)
          • 2. Re: setVolume doesn't seem to work with loadSound
            prtrb Level 1
            I have many sounds in the file, and to manage this I've taken great pains to be sure that there are no scope issues.

            Everything worked fine when I used attachSound(). I switched to loadSound() only to help speed testing and development because it meant I wouldn't have to import, assign linkageIDs, and so on. There are going to be nearly 50 sounds in the complete project. While I'm still testing and re-arranging, anything that can help save some time and make development more flexible is in my best interest. Well, that is if it works as expected...

            Any other suggestions?