Posted By

RubenBristian on 02/11/11


Tagged

as3


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

junaidrao
dubogii


domain restriction on preview files


 / Published in: ActionScript 3
 

  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  

You need to login to post a comment.