3744 posts
  • Won a Competition
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
  • Spain
  • Referred between 200 and 499 users
+5 more
pezflash says

Hi all.

This should be only readed by authors, but as the multiple request for an authors private forum seems to fall in the forgotten (Envato: it’s really so so difficult??) i post it here.

As many authors finally use external previews on their own servers (to add a bonus preview or use php/mysql services, for example) i think we should protect that previews. Obviously we can’t avoid thieves trying to hack them, but at least we can avoid people using directly the swfs.

The idea is using the externalInterface class to run the file only in the owner server address. This is transparent and you skip filling a good preview of watermarks and so. This is the code (as2):

import flash.external.*;
urlPath = ExternalInterface.call("eval","document.location.href");
if (urlPath !== "http://www.author_domain/project_folder_example") {
    _root._visible = false;
}

Hope this will be useful for someone here.

<”}}><

3256 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Beta Tester
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+4 more
ParkerAndKent says

Hi,

you don’t need the external interface to do that, it’s enough to use the local connection class to get the domain where the swf is running. In any case this method (domain lock) is the most used already.

Good suggestion btw…

Parker

1657 posts
  • Exclusive Author
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Sold between 50 000 and 100 000 dollars
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
+2 more
flashedge says
I use this one, posted a while ago.
function isStolen():Boolean 
        {
          var _domain : String = (new LocalConnection()).domain;
          var _allowedDomainList : Array = new Array();

          _allowedDomainList.push("flashedge");
          _allowedDomainList.push("flashden");
          _allowedDomainList.push("activeden");
          _allowedDomainList.push("envato");
          _allowedDomainList.push("localhost");    //add localhost and 127.0.0.1 to be able to run locally
          _allowedDomainList.push("127.0.0.1");

          for(var i : Number = 0; i < _allowedDomainList.length; i++)
            if (_domain.toLowerCase().indexOf(_allowedDomainList[i].toString().toLowerCase()) > -1) return false;
          return true;
        }
4136 posts
  • Bought between 1 and 9 items
  • Brazil
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • Sold between 5 000 and 10 000 dollars
tsafi says
I use this one, posted a while ago.

I remember the day AD change there host, so many files didn’t work and so many update was needed by us .

Best way just do your own encrypted and test it, some encrypted software can encrypted even url links verb` atc` .

1571 posts Building the Web.
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Author had a File in an Envato Bundle
  • Most Wanted Bounty Winner
  • Bought between 50 and 99 items
  • Has been a member for 4-5 years
+2 more
ZoomIt says
I use this one, posted a while ago.
function isStolen():Boolean 
        {
          var _domain : String = (new LocalConnection()).domain;
          var _allowedDomainList : Array = new Array();

          _allowedDomainList.push("flashedge");
          _allowedDomainList.push("flashden");
          _allowedDomainList.push("activeden");
          _allowedDomainList.push("envato");
          _allowedDomainList.push("localhost");    //add localhost and 127.0.0.1 to be able to run locally
          _allowedDomainList.push("127.0.0.1");

          for(var i : Number = 0; i < _allowedDomainList.length; i++)
            if (_domain.toLowerCase().indexOf(_allowedDomainList[i].toString().toLowerCase()) > -1) return false;
          return true;
        }

you just have to call that function from a constructor function ?
great suggestion

2671 posts
  • Bought between 50 and 99 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 50 and 99 users
  • Sold between 100 000 and 250 000 dollars
  • United Kingdom
  • Won a Competition
Chuckanucka says

It would be awesome if AD handled this themselves somehow. Can’t be that hard to implement.

1657 posts
  • Exclusive Author
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Sold between 50 000 and 100 000 dollars
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
+2 more
flashedge says
you just have to call that function from a constructor function ?
great suggestion
Yup, just call it. Like this:
if (isStolen) { trace ("This file has been stolen!");} else { runYourStuff(); }
1571 posts Building the Web.
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Author had a File in an Envato Bundle
  • Most Wanted Bounty Winner
  • Bought between 50 and 99 items
  • Has been a member for 4-5 years
+2 more
ZoomIt says
you just have to call that function from a constructor function ?
great suggestion
Yup, just call it. Like this:
if (isStolen) { trace ("This file has been stolen!");} else { runYourStuff(); }

very cool, thanks

by
by
by
by
by
by