 		public function advancedUpload(url:String, settings:Object):void {
 			var file:File = this, width:int, height:int, quality:int, multipart:Boolean, chunking:Boolean, fileDataName:String;
 			var chunk:int, chunks:int, chunkSize:int, postvars:Object;
-			var onComplete:Function, onIOError:Function,
-				removeAllListeneres:Function = function() : void {
+			var onComplete:Function, onIOError:Function;
+			var removeAllListeners:Function = function() : void {
 					file._fileRef.removeEventListener(Event.COMPLETE, onComplete);
 					file._fileRef.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
 				};

			var file:File = this, fileData:ByteArray, chunkData:ByteArray, req:URLRequest, url:String;
			var onComplete:Function, onIOError:Function, onSecurityError:Function;
			var removeAllEventListeners:Function = function() : void {
				file._urlStream.removeEventListener(Event.COMPLETE, onComplete);
				file._urlStream.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
				file._urlStream.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
			};

			// All chunks uploaded?
			if (this._chunk >= this._chunks) {

			this._cancelled = false;
			this._headers = settings.headers;
			this._mimeType = settings.mime;
			
			// make it available for whole class (cancelUpload requires it for example)
			this._removeAllListeners = removeAllListeners;

			multipart = new Boolean(settings["multipart"]);
			fileDataName = new String(settings["file_data_name"]);
