Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

setVolume problem

Avatar of iamcmag
iamcmag asked on
Adobe Flash
6 Comments1 Solution869 ViewsLast Modified:
Hi.

I have an urgent problem that I've been staring myself blind at and I can't resolve it myself, I must be overlooking something because I think this one should be quite easy.

I've loaded an external sound into a dynamically created movieclip but I can't seem to control the volume which is the last parameter I need to be able to control. I've set the volume to 0 but it still plays at 100%. Test the script using/changing your own loadSound parameter.

Here's my script:

      //Create dynamic MC and load sound
                  this.createEmptyMovieClip("soundMc1", this.getNextHighestDepth());
                  //Creacte new sound object inside MC
                  var sound1:Sound = new Sound(soundMc1);
                  //Set volume
                  sound1.setVolume(0);
                  trace(sound1.getVolume());
                  //Set what happens when sound is finished playing - unload MC from stage
                  sound1.onSoundComplete = function() {
                        unloadMovie("soundMc1")
                        trace("soundMc1 unloaded");
                  }//onSoundComplete function
      
                  //Load sound - streaming false
                  sound1.loadSound(YOUR-SOUND-HERE, false);
                  //Check that sound loaded completely before playing
                  sound1.onLoad = function(success:Boolean):Void {
                  if (success) {
                        sound1.start();
                  }// if success
      }//onLoad function

This topic is extremely urgent and will reward 500 points.

Regards,
Andreas.
ASKER CERTIFIED SOLUTION
Avatar of Aneesh Chopra
Aneesh ChopraFlag of India imageFounder | CTO
Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers