rmo518
October 19th, 2006, 05:30 PM
I have a php script that I call from a Flash movie to set a cookie. The purpose of this cookie is to have the sound turned on or off as a person moves through the site. Everything works fine in FireFox, but in Internet Expolorer (version 6.0.2800.1106 for what it's worth) it won't recognize the cookie until I close IE and open it again - then it does recognize it.
Here's my code:
<?php
$expire = time() + (60*60*24*365*10);
if($_GET['mode'] == 1){
//Sound on
setcookie("audioCookie", 1, $expire, "/", ".mydomain.com", false);
print 'sound=1&setting';
} else if($_GET['mode'] == 0){
// Sound off
setcookie("audioCookie", 0, $expire, "/", ".mydomain.com", false);
print 'sound=0&setting';
} else {
// Checking status
print 'sound='.$_COOKIE['audioCookie'];
}
?> To check the status I use the following AS (In case it matters, I'm working in Flash MX):
audioVars = new LoadVars();
sendVars = new LoadVars();
sendVars.mode = 3;
audioVars.onLoad = function() {
_root.soundCheck = audioVars.sound;
if (audioVars.sound == "0") {
sound_mc.gotoAndStop(2);
}
};
sendVars.sendAndLoad("sound.php", audioVars, "GET");
Any thoughts on how I can fix this?
Here's my code:
<?php
$expire = time() + (60*60*24*365*10);
if($_GET['mode'] == 1){
//Sound on
setcookie("audioCookie", 1, $expire, "/", ".mydomain.com", false);
print 'sound=1&setting';
} else if($_GET['mode'] == 0){
// Sound off
setcookie("audioCookie", 0, $expire, "/", ".mydomain.com", false);
print 'sound=0&setting';
} else {
// Checking status
print 'sound='.$_COOKIE['audioCookie'];
}
?> To check the status I use the following AS (In case it matters, I'm working in Flash MX):
audioVars = new LoadVars();
sendVars = new LoadVars();
sendVars.mode = 3;
audioVars.onLoad = function() {
_root.soundCheck = audioVars.sound;
if (audioVars.sound == "0") {
sound_mc.gotoAndStop(2);
}
};
sendVars.sendAndLoad("sound.php", audioVars, "GET");
Any thoughts on how I can fix this?