Zeph
07-06-2004, 07:10 PM
Hi all, I'm pretty much as newbie as one can get. I can do timelines, transitions, that's about it, but I'm a programmer, so I'm sure I can handle whatever answers I get.
My client has asked me to build a flash presentation, but wants to prevent others from running it on their site. I can restrict leeching with a .htaccess, so that's good.
On loading, I would like to use actionscript to get the movie to check the current domain, if it does not match the domain embedded in a movie, it redirects to the owner's domain. Pseudo code to illustrate:
var myDomain = "http://www.mydomain.com";
function checkDomain ()
{
c = currentDomain();
if (c != myDomain)
{
stop();
redirect (myDomain);
}
}
onLoad (checkDomain);
At the very least, if I can't redirect, I'd like to be able to stop the flash and display a frame with "Please visit http://www.mydomain.com."
Can someone suggest how I can go about doing this?
Thank you.
My client has asked me to build a flash presentation, but wants to prevent others from running it on their site. I can restrict leeching with a .htaccess, so that's good.
On loading, I would like to use actionscript to get the movie to check the current domain, if it does not match the domain embedded in a movie, it redirects to the owner's domain. Pseudo code to illustrate:
var myDomain = "http://www.mydomain.com";
function checkDomain ()
{
c = currentDomain();
if (c != myDomain)
{
stop();
redirect (myDomain);
}
}
onLoad (checkDomain);
At the very least, if I can't redirect, I'd like to be able to stop the flash and display a frame with "Please visit http://www.mydomain.com."
Can someone suggest how I can go about doing this?
Thank you.