1081 posts
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Has been a member for 6-7 years
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Interviewed on the Envato Notes blog
  • Referred between 500 and 999 users
+4 more
damojo says

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 :p

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?

4145 posts Community Mod Building awesome stuff for your mobile devices!
  • Community Moderator
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Interviewed on the Envato Notes blog
  • Author had a Free File of the Month
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
+9 more
Enabled Volunteer moderator says
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 :p

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?

+ x

x = (1, infinite)

Great ideea!

1676 posts Envato Elite Author
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Author had a Free File of the Month
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
+1 more
Tean says

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
}
8186 posts Community Moderator
  • Attended a Community Meetup
  • Community Moderator
  • Has been a member for 6-7 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
+4 more
MSFX Volunteer moderator says

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…

2162 posts
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 10 000 and 50 000 dollars
  • Grew a moustache for the Envato Movember competition
  • Beta Tester
  • Bought between 50 and 99 items
  • Canada
Nitro_Themes says
8186 posts Community Moderator
  • Attended a Community Meetup
  • Community Moderator
  • Has been a member for 6-7 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
+4 more
MSFX Volunteer moderator says

^ why are you using an EnterFrame for that?

1081 posts
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Has been a member for 6-7 years
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Interviewed on the Envato Notes blog
  • Referred between 500 and 999 users
+4 more
damojo says

Thanks for the input guys I’ll give that a try.

Cool new logo MSFX :P Did fifty design that?

8186 posts Community Moderator
  • Attended a Community Meetup
  • Community Moderator
  • Has been a member for 6-7 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
+4 more
MSFX Volunteer moderator says

thanks :)

It was this guy :)

by
by
by
by
by
by