A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Mute button help

  1. #1
    Junior Member
    Join Date
    Jun 2009
    Posts
    7

    Mute button help

    I am trying to make a button that will mute the sound when you scroll over the links, the sound instance name is CameraFlash this is my code, i took a tutorial i found on google (http://www.youtube.com/watch?v=HxDTUngwX0M), but it isnt working in this situation... Also there needs to be one other sound muted when this is pressed what would i change in this to make that happen? Oh and one more thing, can i just copy and paste this into other scenes of my website? i dont want the viewer to have to hit mute on every page.. sorry I'm a noob any help would be much appreciated!
    Code:
    var sound = 1;
    var slashMC = _root.attachMovie("slash","slash01",99);
    slash01._visible = false;
    slashMC._y = btn._y;
    slashMC._x = btn._x;
    var s;Sound = new Sound();
    s.attachSound("CameraFlash");
    btn.onPress = function(){
    	if(sound==1){
    		s.setVolume(0);
    		slash01._visible = true;
    		sound = 0;
    	}
    	else if (sound==0){
    		sound = 1;
    		slash01._visible = false;
    		s.setVolume(100);
    	}
    }
    Last edited by Jelah; 06-12-2009 at 10:00 AM. Reason: tried tutorial

  2. #2
    Junior Member
    Join Date
    Jun 2009
    Posts
    7
    Hey guys, was there anything else that I needed to include so that you can help me with this problem? Just let me know.

    Thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center