 /**
  * Allows you to load an embeded SWF stored as a Byte Array then access any stored classes
  * within the SWF.
+ *
+ * An Event.COMPLETE will be dispatched upon the successful completion of a call to
+ * {@link load}.  IOErrorEvent.IO_ERROR will be dispatched if there's a problem reading the
+ * ByteArray.
  */
 public class EmbededClassLoader extends EventDispatcher 
 {
-    public static var SWF_LOADED :String = "swfLoaded";
-    public static var LOAD_ERROR :String = "loadError";
-
     public function EmbededClassLoader ()
     {
         _loader = new Loader();

     */
    public function getClass (className :String) :Class
    {
        if (_loader.contentLoaderInfo.bytesLoaded != _loader.contentLoaderInfo.bytesTotal) {
            throw new IllegalOperationError("SWF has not completed loading");
        }
        try {
            return _loader.contentLoaderInfo.applicationDomain.getDefinition(className) as Class;
        } catch (e: Error) {
            throw new IllegalOperationError(className + " definition not found");
        }
        return null;
    }

    /**
     * Checks if a class exists in the library.
     *
     * @throws IllegalOperationError when the swf has not completed loading.
     */
    public function isClass (className :String) :Boolean
    {
        if (_loader.contentLoaderInfo.bytesLoaded != _loader.contentLoaderInfo.bytesTotal) {
            throw new IllegalOperationError("SWF has not completed loading");
        }
        return _loader.contentLoaderInfo.applicationDomain.hasDefinition(className);
    }

    protected function completeHandler (e :Event) :void
    {
        dispatchEvent(new Event(SWF_LOADED));
    }

    protected function ioErrorHandler (E :Event) :void
    {
        dispatchEvent(new Event(LOAD_ERROR));
    }

    protected var _loader :Loader;

package com.threerings.util {

import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.errors.IllegalOperationError;
import flash.events.Event;
import flash.events.EventDispatcher;
