I’ve found an example of this
http://www.sitepal.com/showcases
If you click on the mute button at the top, then navigate to another page, the mute button stays clicked.
I have a decompiler, and pulled the code out of it. See below:
function acknowledge(method)
{
sLC.send("lc_out_" + tStamp, "acknowledge", method);
}
function muteHost(action)
{
if (action)
{
modSound.setVolume(0);
vhost.stopSpeech();
muteBtn.gotoAndStop(3);
shellAudioLogic.mute(true);
return;
}
modSound.setVolume(100);
muteBtn.gotoAndStop(1);
shellAudioLogic.mute(false);
}
function ctrlClick(obj, val)
{
if ((__reg0 = obj) === "muteBtn")
{
if (val == 1)
{
muteHost(true);
}
else
{
muteHost(false);
}
return;
}
else
{
if (__reg0 === "stopBtn")
{
vhost.gotoScene(lastIndex);
talkEnded = null;
vhost.stopSpeech();
return;
}
else
{
if (__reg0 === "replayBtn")
{
forceMute = false;
muteHost(false);
if (homepage)
{
vhost.gotoScene(replaySlideIndex);
}
else
{
vhost.gotoScene(replaySlideIndex);
}
return;
}
else
{
if (__reg0 !== "testBtn")
{
return;
}
}
}
}
vhost.sayText("bla bla bla bla bla", 2, 2, 1);
return;
}
function vhostLoadedDone()
{
fakeLoader.gotoAndStop(1);
fakeLoader._visible = 0;
}
System.security.allowDomain("vhss-c.oddcast.com", "vhss-a.oddcast.com", "www.oddcast.com", "www2.staging.oddcast.com", "vhost.oddcast.com", "vhost.staging.oddcast.com, oddcast.staging.oddcast.com, oddcast.dev.oddcast.com");
pedingTTS = false;
forceMute = false;
modSound = new Sound(this);
gender = "F";
replaySlideIndex = homepage ? 2 : 1;
api = new Object();
var rLC = new LocalConnection();
var sLC = new LocalConnection();
rLC.sayAudio = function (audio)
{
api.sayAudio(audio);
acknowledge("sayAudio");
}
;
rLC.stopSpeech = function ()
{
api.stopSpeech();
acknowledge("stopSpeech");
}
;
rLC.connect("lc_in_" + tStamp);
but.onRelease = function ()
{
silenceHost.gotoAndPlay(2);
}
;
api.sayAudio = function (audio)
{
muteHost(0);
vhost.setStatus(1);
vhost.sayAudio(audio);
}
;
api.stopSpeech = function ()
{
talkEnded = null;
this.called = true;
vhost.stopSpeech();
}
;
sitepalPath = "/";
_debug3 = baseDir;
stop();
var shellAudioLogic = new AudioLogic(vhostURL, noGreeting == 1 ? 1 : cookieExists, homepage, vhost, this, contentName);
I can’t quite figure out how to implement this. Any ideas would be greatly appreciated.
Thanks!!