Re: [Flashcoders] Sound control problem

2012-02-17 Thread Glen Pike

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


Re: [Flashcoders] Sound control problem

2012-02-16 Thread Karl DeSaulniers

Where is the var soundTransform being set first?
I dont see it. Is it public or private?
_so I see being set but not soundTransform.

Best,
Karl


On Feb 16, 2012, at 1:48 PM, 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


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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


[Flashcoders] Sound control problem

2012-02-16 Thread natalia Vikhtinskaya
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