- Sold between 250 000 and 1 000 000 dollars
- Has been a member for 5-6 years
- Author was Featured
- Item was Featured
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Interviewed on the Envato Notes blog
- Referred between 200 and 499 users
Im used to domain locking my as2 files so they can only be run locally and on Envato servers.
I tried a domain lock for my last as3 file but it didn’t work for some reason causing the preview to be broke for a week (it worked on my server though).
Could someone please share their working as3 domain locking code, I don’t feel like experimenting and having my previews broke anymore 
Maybe it would be a good idea for reviewers to domain lock all files in the future?
And another thing: Which as3 swf encryption tool do you recommend?
- Has been a member for 4-5 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 50 000 and 100 000 dollars
- Microlancer Beta Tester
- Community Moderator
- Interviewed on the Envato Notes blog
- Author was Featured
- Bought between 1 and 9 items
- Referred between 50 and 99 users
Im used to domain locking my as2 files so they can only be run locally and on Envato servers.I tried a domain lock for my last as3 file but it didn’t work for some reason causing the preview to be broke for a week (it worked on my server though).
Could someone please share their working as3 domain locking code, I don’t feel like experimenting and having my previews broke anymoreMaybe it would be a good idea for reviewers to domain lock all files in the future?
And another thing: Which as3 swf encryption tool do you recommend?
+ x
x = (1, infinite)
Great ideea!
- Sold between 50 000 and 100 000 dollars
- Author was Featured
- Author had a Free File of the Month
- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Europe
- Has been a member for 3-4 years
- Referred between 10 and 49 users
Just check the url property of your roots loaderInfo object. If not the url you expect, don’t run the movie.
if (loaderInfo.url.toString().indexOf("www.mydomain.com") != -1)
{
//proceed with the rest of the code
}
- Attended a Community Meetup
- Community Moderator
- Has been a member for 5-6 years
- United Kingdom
- Contributed a Tutorial to a Tuts+ Site
- Won a Competition
- Contributed a Blog Post
- Beta Tester
- Bought between 50 and 99 items
I used to use this for if testing against several allowed and / or disallowed domains…
public class ValidateURL
{
public function ValidateURL():void { }
public static function validate(url:String, allowedDomains:Array = null, disAllowedDomains:Array = null):Boolean
{
var validDomain:Boolean = false;
var noAllowedDomains:int = allowedDomains.length;
var noDisAllowedDomains:int = disAllowedDomains.length;
var i:int;
if (allowedDomains != null)
{
for (i = 0; i < noAllowedDomains; i++) // if the url includes one of the allowed domains signal loading allowed
{
if (url.indexOf(allowedDomains[i]) >= 0) validDomain = true;
}
trace("ValidateURL() | URL Tested on Allowed Domains | URL Valid: " + validDomain + "\n");
}
if (disAllowedDomains != null)
{
for (i = 0; i < noDisAllowedDomains; i++) // if the url includes one of the disallowed domains signal loading NOT allowed
{
if (url.indexOf(disAllowedDomains[i]) >= 0) validDomain = false;
}
trace("ValidateURL() | URL Tested on DisAllowed Domains | URL Valid: " + validDomain + "\n");
}
return validDomain;
}
}
And as Tean said you just pass the this.loaderInfo.url into the function…
- Attended a Community Meetup
- Community Moderator
- Has been a member for 5-6 years
- United Kingdom
- Contributed a Tutorial to a Tuts+ Site
- Won a Competition
- Contributed a Blog Post
- Beta Tester
- Bought between 50 and 99 items
^ why are you using an EnterFrame for that?
- Sold between 250 000 and 1 000 000 dollars
- Has been a member for 5-6 years
- Author was Featured
- Item was Featured
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Interviewed on the Envato Notes blog
- Referred between 200 and 499 users
Thanks for the input guys I’ll give that a try.
Cool new logo MSFX
Did fifty design that?
- Attended a Community Meetup
- Community Moderator
- Has been a member for 5-6 years
- United Kingdom
- Contributed a Tutorial to a Tuts+ Site
- Won a Competition
- Contributed a Blog Post
- Beta Tester
- Bought between 50 and 99 items

