So you've built some Flash to post to your own website. Unfortunately, there's no way that works 100% of the time to protect your files from being downloaded, and posted to another website. Why would you want to do that anyway? It's good to get your work out there right? Of course it is, but as the designer you at least deserve credit for your work. That's where conditional branding based on domain comes in.
You might have noticed that if you do a view source, get the address, and download any of the Flash files on my site and play them on either your local machine, or posted to another site, my logo appears as a link back to my site. Having my logo appear when my files are located on my own server would be pointless and redundant, but if your Flash files travel, may as well show your logo.
The way I do this is with some pretty simple actionscript. But first, make your logo into a movie clip by putting it on the stage, presumably at frame 1, and hit the F8 key. Assign it a name, like logo_mc. Give the movie clip on the stage the same instance name in it's properties box. On a separate layer, put this actionscript on a keyframe at frame 1:
logo_mc.onRelease=function() {
getURL("http://www.yourdomain.net", _blank);
}
//This makes your logo_mc movie clip open yourdomain.net in a new browser window when it's clicked.
var localDomain:LocalConnection = new LocalConnection();
myDomainName = localDomain.domain();
//These two lines get the domain that your Flash file resides on, and assigns the value to a variable called myDomainName
if (myDomainName == "www.yourdomain.net") {
logo_mc._visible=false;
}
//this condition says that if the domain name that's been assigned to myDomainName equals yours, your logo is invisible.
if (myDomainName <> "www.yourdomain.net") {
logo_mc._visible=true;
}
//same condition, just the other way. If the domain name that's been assigned to myDomainName does not equal yours, your logo is visible.
It works, and it's nothing new so you dont have to worry about their Flash player being the most current either.