Hi,

I think you need to set the soundTransform of the MovieClip that contains the timeline sound?

Also look at the SoundMixer class for "global" controls - you may need the stopAll functionality when you add and remove MC's with sound to/from the stage.

Glen

On 16/02/2012 19:48, natalia Vikhtinskaya wrote:
Hi
I have mute button with class linked to this mc in the library

package lib
{
      import flash.display.*;
     import flash.events.*;
     import flash.utils.*;
        import flash.media.*;

  public class MuteControl extends flash.display.MovieClip
     {
         private var _so:SoundTransform;
         public function MuteControl()
         {
                        
                        _so=new SoundTransform();
                        _so.volume = 1;
                        soundTransform=_so;
                        this.addEventListener(MouseEvent.CLICK, 
muteControlButton);
                        this.buttonMode = true;
                        this.mouseChildren = false;
                return;
         }



       private function muteControlButton(e:MouseEvent):void {
                        if (_so.volume==1){
                                _so.volume=0;
                                e.target.gotoAndStop(2);
                        } else {
                                _so.volume=1;
                                e.target.gotoAndStop(1);
                        }
                        this.soundTransform = _so;  //nothing changes
}

                
                
     }

}

muteControlButton function works correctly but sound does not change.
Sound file attached on Timeline. What is wrong?

Please advice.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to