Hey all,
Feel like an idiot here. I am trying to use the Boolean datatype for the first time. I have code that I want to mute sound. My function in my external movie works, but I cannot get the mute to convert to turn up the volume after I’ve set the volume to 0. Attached is my code:
ActionScript Code:
[FONT=Courier New][LEFT]mute_btn.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]
[COLOR=#000000]{[/COLOR]
[COLOR=#000000]var[/COLOR] muter:[COLOR=#0000ff]Boolean[/COLOR];
movieSound = empty_mc.[COLOR=#000080]snd1[/COLOR].[COLOR=#0000ff]setVolume[/COLOR]COLOR=#000000[/COLOR]
[COLOR=#0000ff]if[/COLOR][COLOR=#000000]([/COLOR]muter == [COLOR=#000000]**true**[/COLOR][COLOR=#000000])[/COLOR]
[COLOR=#000000]{[/COLOR]
movieSound = [COLOR=#000000]**true**[/COLOR];
[COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"true"[/COLOR][COLOR=#000000])[/COLOR];
muter = [COLOR=#000000]**false**[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#0000ff]else[/COLOR]
[COLOR=#000000]{[/COLOR]
movieSound = [COLOR=#000000]**false**[/COLOR];
[COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"false"[/COLOR][COLOR=#000000])[/COLOR];
muter = [COLOR=#000000]**true**[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
The only trace I get is “false”. All I want is a simple mute button.
Thanks.