 			
 		}
 				
+		// borrowed from jPLayer 
+		// https://github.com/happyworm/jPlayer/blob/e8ca190f7f972a6a421cb95f09e138720e40ed6d/actionscript/Jplayer.as#L228
+		private function checkFlashVars(p:Object):void {
+			var i:Number = 0;
+			for each (var s:String in p) {
+				if (isIllegalChar(s)) {
+					securityIssue = true; // Illegal char found
+				}
+				i++;
+			}
+			if(i === 0 || securityIssue) {
+				directAccess = true;
+			}
+		}
+		
+		private function isIllegalChar(s:String):Boolean {
+			var illegals:String = "' \" ( ) { } * + / \\ < > = document";
+			if(Boolean(s)) { // Otherwise exception if parameter null.
+				for each (var illegal:String in illegals.split(' ')) {
+					if(s.indexOf(illegal) >= 0) {
+						return true; // Illegal char found
+					}
+				}
+			}
+			return false;
+		}				
+				
+				
 		// START: Controls and events
 		function mouseActivityMove(event:MouseEvent):void {
 			

        private var _idleTime:int;
        private var _isMouseActive:Boolean
		private var _isOverStage:Boolean = false;


		public function FlashMediaElement() {

			// show allow this player to be called from a different domain than the HTML page hosting the player
			Security.allowDomain("*");

			// get parameters
			var params:Object = LoaderInfo(this.root.loaderInfo).parameters;
			_mediaUrl = (params['file'] != undefined) ? String(params['file']).replace("\\\"","") : ""; // replacing quotes is for XSS
			_autoplay = (params['autoplay'] != undefined) ? (String(params['autoplay']) == "true") : false;
			_debug = (params['debug'] != undefined) ? (String(params['debug']) == "true") : false;
			_isVideo = (params['isvideo'] != undefined) ? ((String(params['isvideo']) == "false") ? false : true  ) : true;

			_pseudoStreamingStartQueryParam = (params['pseudostreamstart'] != undefined) ? (String(params['pseudostreamstart'])) : "start";
			_streamer = (params['flashstreamer'] != undefined) ? (String(params['flashstreamer'])) : "";

			_output.visible = _debug;	
			
			if (isNaN(_timerRate))
				_timerRate = 250;
