@Tizbo1423
I do something like what you are looking to impliment on my Home Page. I use the javascript shown below.
Code:
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
/*
expire_time*24*60*60*1000
to make it for hours,
delete * 24, for minutes, delete * 24 * 60
*/
function createCookie(name,value,expire_time) {
if (expire_time) {
var date = new Date();
date.setTime(date.getTime()+(expire_time*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
var flashvars =
{
autostart: 'true',
enablejs: 'true',
javascriptid: 'y',
file: 'comments.flv',
skin: '',
image: 'none',
menu: 'false',
icons: 'false',
controlbar: 'none',
transparent: 'true',
volume: '80'
};
var params =
{
allowscriptaccess: 'always',
wmode: 'transparent',
bgcolor: '#BFCFFF'
};
var attributes =
{
id: 'playerId',
name: 'playerId'
};
if ( window.readCookie ) {
// See if cookie has been set
if (readCookie("NewUser")=="true") {
flashvars.autostart = 'false';
} else {
flashvars.autostart = 'true';
}
} else {
flashvars.autostart = 'true';
}
swfobject.embedSWF('player.swf', 'player', '400', '223', '8', false, flashvars, params, attributes);
// Disable Auto Play
// - see if js function exist, the function should only exist on the pages you want to limit autoplay
//
if ( window.readCookie ) {
// If cookie has not been set, then set it
if (readCookie("NewUser")!="true") {
createCookie("NewUser","true",1); /* set to 1 minute for testing */
}
}
Hope this will help you - Jim