I want to prevent users from using webcam emulators, I have done that in AS2 by using senocular's function, but I can't make it work in AS3,so, here is the old version by senocular , and I would like to do the same in AS3, tried using indexOf but doesn't work, I need to find at least the first 4 characters of the string and compare them to the item inside the array in AS3!
String.prototype.startsWith = function(str){ return !this.indexOf(str); } here is what I want to do:
var bannedDevices = new Array("FakeCam","SplitCam","Phillips Capture Card 7xx","VLC"); var myDeviceName = "SplitCam v1.5"; //"Splitcam" in bannedDevices should trigger this; if (myDeviceName.indexOf(bannedDevices)){ trace("banned device"); } Thanks for the help !