1082 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Has been part of the Envato Community for over 6 years
+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?

4601 posts Community Mod Building awesome stuff for your mobile devices!
  • Contributed a blog post
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Has sold $125,000+ on Envato Market
+15 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!

1682 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
}
8378 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 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…

2251 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Has referred 1+ members
  • Helped several times protecting Envato Market against copyright violations
+5 more
Nitro_Themes says
8378 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 Moderator says

^ why are you using an EnterFrame for that?

1082 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Has been part of the Envato Community for over 6 years
+9 more
damojo says

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

Cool new logo MSFX :P Did fifty design that?

8378 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 Moderator says

thanks :)

It was this guy :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by