3757 posts
  • Elite Author
  • Spain
  • Author Level 8
  • Featured Author
+11 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
  • Affiliate Level 4
  • Author Level 9
  • Collector Level 2
  • Top Monthly Author
+11 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

1665 posts
  • Trendsetter
  • Weekly Top Seller
  • Winner
  • Featured Author
+10 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;
        }
4140 posts
  • 7 Years of Membership
  • Affiliate Level 1
  • Author Level 4
  • Brazil
+5 more
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` .

1744 posts Building the Web.
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Beta Tester
+10 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
  • 8 Years of Membership
  • Affiliate Level 4
  • Author Level 7
  • Collector Level 3
+7 more
Chuckanucka
says

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

1665 posts
  • Trendsetter
  • Weekly Top Seller
  • Winner
  • Featured Author
+10 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(); }
1744 posts Building the Web.
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Beta Tester
+10 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