只是字符串的判断,同时禁止了在本地硬盘播放。
var MoFunZone_URL="yidianxindong.com"; var testinput=loaderInfo.url; var skipright=testinput.split("/"); testinput=skipright[0]+"//"+skipright[1]+skipright[2]+"/"; var mofunzonedcom=testinput.substring(testinput.length-17); var prefixtext=testinput.substring(0,testinput.length-17); var cliphttpwww=prefixtext.substring(prefixtext.indexOf("http://")+7); var cliplastdot=cliphttpwww.substring(0,cliphttpwww.length-1); var havedot=cliplastdot.indexOf(".")!=-1; var MoFunZone_path=mofunzonedcom; if ((MoFunZone_path != MoFunZone_URL && MoFunZone_path != "file:///") || havedot ) { var black = new MovieClip(); black.graphics.beginFill(0x000000); black.graphics.drawRect(0,0,10000,10000); black.graphics.endFill(); this.addChild(black); return; }