1081 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has referred 500+ members
+9 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?

4203 posts Community Mod Building awesome stuff for your mobile devices!
  • Has referred 100+ members
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
+14 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!

1677 posts Envato Elite Author
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 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
}
8234 posts Community Moderator
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Attended one of our Meetups around the world
+9 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…

2186 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Helped several times protecting Envato Market against copyright violations
  • Sells items exclusively on Envato Market
+4 more
Nitro_Themes says
8234 posts Community Moderator
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Attended one of our Meetups around the world
+9 more
MSFX Volunteer moderator says

^ why are you using an EnterFrame for that?

1081 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has referred 500+ members
+9 more
damojo says

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

Cool new logo MSFX :P Did fifty design that?

8234 posts Community Moderator
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Attended one of our Meetups around the world
+9 more
MSFX Volunteer moderator says

thanks :)

It was this guy :)

by
by
by
by
by
by