Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Sound problem

Sound problem

2004-03-01       - By Christophe

 Back
Hi,

I have a volume slider that works ok and a mute button that works ok.
But when I combine the two the mute button doesn't work properly
anymore.
The sound mutes (when there's volume), but doesn't "unmute" anymore.

Can anyone tell me where I went wrong?

var drag:Boolean;
var muteVar:Boolean = false;
muteButtonPos = function () {
  if (muteVar == false) {
    _root.rack_mc.mute_mc.gotoAndStop("unmute");
  } else {
    _root.rack_mc.mute_mc.gotoAndStop("mute");
  }
};
_root.rack_mc.v_slider_mc.v_rechthoek_mc.onPress = function() {
  drag = true;
};
_root.rack_mc.v_slider_mc.v_rechthoek_mc.onReleaseOutside = function() {
  drag = false;
};
_root.rack_mc.v_slider_mc.v_rechthoek_mc.onRelease = function() {
  drag = false;
};
_root.onEnterFrame = function() {
  var sliderposition:Number =
_root.rack_mc.v_slider_mc.v_rechthoek_mc._x;
  if (drag) {
    _root.rack_mc.v_slider_mc.v_rechthoek_mc._x =
_root.rack_mc.v_slider_mc._xmouse;
    if (_root.rack_mc.v_slider_mc.v_rechthoek_mc._x<=0) {
      _root.rack_mc.v_slider_mc.v_rechthoek_mc._x = 0;
      muteVar = true;
      muteButtonPos();
    }
    if (_root.rack_mc.v_slider_mc.v_rechthoek_mc._x>=100) {
      _root.rack_mc.v_slider_mc.v_rechthoek_mc._x =
100;
    }
    if (_root.rack_mc.v_slider_mc.v_rechthoek_mc._x>0 &&
_root.rack_mc.v_slider_mc.v_rechthoek_mc._x<100) {
      muteVar = false;
      muteButtonPos();
    }
    _root.globalvolume.setVolume(sliderposition);
  }
  _root.rack_mc.mute_mc.onRelease = function() {
    if (_root.globalvolume.getVolume()>0 && muteVar ==
false) {
      _root.globalvolume.setVolume(0);
      muteVar = true;
      muteButtonPos();
    } else if (_root.globalvolume.getVolume()>0 && muteVar
== true) {
      _root.globalvolume.setVolume(sliderposition);
      muteVar = false;
      muteButtonPos();
    }
    if (_root.globalvolume.getVolume() == 0) {
      muteVar = true;
      muteButtonPos();
    } else {
      _root.globalvolume.setVolume(sliderposition);
      muteVar = false;
      muteButtonPos();
    }
  };
};


Thx
Christophe



-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Supported by Fig Leaf Software
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Lower Prices for Certified Training! Check out new lower prices for
Certified Macromedia Training from Fig Leaf Software. Expand your
skill set with courses in ColdFusion, Flash, Rich Internet
Applications and .NET in the new year.  Fig Leaf Software provides
the highest caliber instruction at our training centers in Washington  
D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at
your location.

Get the details at http://training.figleaf.com/
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected)
For additional commands, e-mail: flashnewbie-help@(protected)