1085 posts
  • Had an item that was trending
  • Had an item that became a weekly top seller
  • Became a Top 20 Author of the Month
  • Elite Author: Sold more than $75,000 on Envato Market
+12 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?

4939 posts Community Mod Building awesome stuff for your mobile devices!
  • Had an item that was trending
  • Had an item that became a weekly top seller
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
+17 more
Enabled
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!

1688 posts Envato Elite Author
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Became a Top 20 Author of the Month
+8 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
}
8576 posts Community Moderator
  • Located in United Kingdom
  • Has been part of the Envato Community for over 7 years
  • Helps us moderate the forums
  • Won a competition
+10 more
MSFX
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…

2321 posts
  • Became a Top 20 Author of the Month
  • Had an item that became a weekly top seller
  • Has sold $10,000+ on Envato Market
  • Has collected 50+ items on Envato Market
+7 more
Nitro_Themes
says
8576 posts Community Moderator
  • Located in United Kingdom
  • Has been part of the Envato Community for over 7 years
  • Helps us moderate the forums
  • Won a competition
+10 more
MSFX
Moderator
says

^ why are you using an EnterFrame for that?

1085 posts
  • Had an item that was trending
  • Had an item that became a weekly top seller
  • Became a Top 20 Author of the Month
  • Elite Author: Sold more than $75,000 on Envato Market
+12 more
damojo
says

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

Cool new logo MSFX :P Did fifty design that?

8576 posts Community Moderator
  • Located in United Kingdom
  • Has been part of the Envato Community for over 7 years
  • Helps us moderate the forums
  • Won a competition
+10 more
MSFX
Moderator
says

thanks :)

It was this guy :)

by
by
by
by
by
by