I got this snippet online and for the life of me I can't seem to make it
write the cookie....
The Flash has the labels mentioned in the code and I used the name=movie and
the swconnect=true as mentioned in the comments.
The movie is fine.....the code is just not writing the cookie at all...
Could someone take a look and see if you can figure out why it won't work?
Thanks,
FayeC
Code as follows:
<script language="javascript">
////////////////////////////////////////////////////////////////////////////
/////
// makeCookie is called when the page loads and only sets the cookie
// if the user does not have one.
// we can communicate with the swf by naming it in the <object> and <embed>
tags
// in the <object> tag you will see id=movie and
// in the <embed> tag i put name=movie swLiveConnect=True
// a list of javascript methods for flash are available at
www.macromedia.com/support/flash
// and type javascript methods into the search box
////////////////////////////////////////////////////////////////////////////
/////
function makeCookie(){
var movie = window.document.movie;
movie.StopPlay();
// only makes the cookie if don't have one
if(document.cookie == "") {
// play the intro
movie.Play();
// the cookie expires on this date
var date = new Date();
date.setDate(date.getDate() + 30);
// make the cookie date readable by the browser
var da_date = date.toGMTString();
var da_cookie = "visited:True" + ";expires=" + da_date;
document.cookie = da_cookie;
//uncomment the alert below to see the cookies value
//alert(da_cookie)
}
else
// if they have the cookie - fire the readIt function
readIt()
}
////////////////////////////////////////////////////////////////////////////
/////
function readIt(){
var movie = window.document.movie;
// this tells the .swf which frame to go to
// it could send any number of commands to the .swf
// send the movie to frame 3
movie.TGotoLabel("/", "no_sound");
}
////////////////////////////////////////////////////////////////////////////
/////
</script>