Domain Control

Blacklist websites, or make it only possible for a few to work. Either way, you can make it so your Flash only works in certain locations.

It only takes a simple code to protect your flash from websites. Basically, these codes will move the file's stage location to an off-location, making it unable to be viewed or played.

To make it that only a few websites work with the file:
This will make a simple list of Flash websites that can use the Flash. All other websites will be blocked.

1) Click the first frame of your movie, where the preloader is.

2) Open the actions panel.

3) If you only want one website to work, paste the code:

onEnterFrame = function () {
urlStart = _url.indexOf("://")+3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".")-1;
domEnd = domain.lastIndexOf(".", LastDot)+1;
domain = domain.substring(domEnd, domain.length);

if (domain != "mywebsite.com") {

_root._x = 50000;
_root._y = 40000;
}
};

If you have multiple domains you would like to allow, use this code:

onEnterFrame = function () {
urlStart = _url.indexOf("://")+3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".")-1;
domEnd = domain.lastIndexOf(".", LastDot)+1;
domain = domain.substring(domEnd, domain.length);

if (domain != "mywebsite.com" && domain != "mywebsite2.com" && domain != "website3.com") {

_root._x = 50000;
_root._y = 40000;
}
};

To make it so a website is excluded from the Flash (Blacklist):
The domains on this list will NOT be allowed to view the Flash. All other domains will be open to view the Flash.

1) Click the first frame of your movie, where the preloader is.

2) Open the actions panel.

3) Paste the code if you only have one domain to blacklist:

onEnterFrame = function () {
urlStart = _url.indexOf("://")+3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".")-1;
domEnd = domain.lastIndexOf(".", LastDot)+1;
domain = domain.substring(domEnd, domain.length);

if (domain == "mywebsite.com") {

_root._x = 50000;
_root._y = 40000;
}
};

If you have multiple domains to blacklist:

onEnterFrame = function () {
urlStart = _url.indexOf("://")+3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".")-1;
domEnd = domain.lastIndexOf(".", LastDot)+1;
domain = domain.substring(domEnd, domain.length);

if (domain == "mywebsite.com" || domain == "mywebsite2") {

_root._x = 50000;
_root._y = 40000;
}
};

Your code will now be protected so that it only works on certain websites! Congratulations!