 				for (var n:String in map) {
 					ExternalInterface.addCallback(n, map[n]);
 				}
-                // NOTE this is in an ENTER_FRAME to deal with a race issue in IE caused by caching
+				// NOTE this is in an ENTER_FRAME to deal with a race issue in IE caused by caching
 				this.addEventListener(Event.ENTER_FRAME, handleReady, false, 0, true);
 			} catch (e:*) {
 				handleError(e);

			log("Complete", wrapper.id, "Remaining:", activeSoundCount);
		}

        // An instance loop callback.
        protected function handleSoundLoop(event:Event):void {
            var wrapper:SoundWrapper = event.target as SoundWrapper;
            ExternalInterface.call(SOUND_CALLBACK, wrapper.id, "handleSoundLoop");
            log("Loop", wrapper.id, "Remaining:", wrapper.loop);
        }

        protected function handleSoundInterrupt(id:String):void {
			var wrapper:SoundWrapper = getWrapper(id, true);
			if (wrapper != null) {
				log("Interrupted", wrapper.id);


	// Sound playback has completed.
	protected function handleSoundComplete(event:Event):void {
		offset = 0;  // have to set this as it can be set by pause during playback
		if (loop != 0) {
			//only decrement loop if it is not -1
			if(loop > 0) loop--;  // NOTE this introduces a theoretical limit on loops = float max size x 2 - 1

			startSound(offset);

			dispatchEvent(new Event("loop"));
		} else {
			dispatchEvent(event);
		}
	}

	// An error has occurred.
