domain restriction on preview files


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public function isStolen():Boolean {
  2. var _domain : String = (new LocalConnection()).domain;
  3. var _allowedDomainList : Array = new Array();
  4.  
  5. //------- add here all strings that would have to be found in allowed domain names --------o
  6. _allowedDomainList.push("localhost");
  7. _allowedDomainList.push("domain1");
  8. _allowedDomainList.push("domain2");
  9. //--------------------------------------------o
  10.  
  11. for (var i : Number = 0; i < _allowedDomainList.length; i++) {
  12. if (_domain.toLowerCase().indexOf(_allowedDomainList[i].toString().toLowerCase())>-1) {
  13. return false;
  14. }
  15. }
  16. return true;
  17. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.