title: Embed unknown file formats
body: <p>Using the Embed tag, we can embed in the swf file not only swf's or jpg's etc, but also unsupported file formats like:</p>
  
  <p><code>
  Embed[(source="mzip.zip", mimeType="application/octet-stream")]</p>
  
  <p>public static MyZip:Class;
  </code></p>
  
  <p>When i instantiate such a class, what type of object do i get? Is it possible to get a ByteArray from this class?</p>
  
  <p>When i do this:
  <code>package {
      import flash.utils.ByteArray;</p>
  
  <pre><code>public final class Resource {       
      [Embed(source="p2.zip", mimeType="application/octet-stream")]
      public static const MyZip:Class;
  
      public static function getByteArrayFromZip():ByteArray {
          var zip:ByteArray = new MyZip as ByteArray;
          return zip;
      }
  }
  </code></pre>
  
  <p>} </code></p>
  
  <p>and </p>
  
  <p><code>  public class Main extends Sprite {<br>
          private var ship:Bitmap;
          private var lib:FZipLibrary;                                </p>
  
  <pre><code>    public function Main() {            
          lib = new FZipLibrary();    
          lib.formatAsBitmapData(".jpg");       
          lib.addEventListener(Event.COMPLETE,onCompleteHandler);
  
          var fzip:FZip = new FZip();
          fzip.loadBytes(Resource.getByteArrayFromZip());
          lib.addZip(fzip);
      }
  
     private function onCompleteHandler(evt:Event) {
          var image:BitmapData = lib.getBitmapData("assets/graphics/scratchers/myimg.jpg");
          trace("Size: " + image.width + "x" + image.height); 
          var sa0img0:Bitmap = new Bitmap(image);
          addChild(sa0img0);
     }
  }
  </code></pre>
  
  <p>} </code></p>
  
  <p>The i get the following error:
  <code>TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at Main/onCompleteHandler()
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at deng.fzip::FZipLibrary/processNext()
      at deng.fzip::FZipLibrary/loaderCompleteHandler() </code></p>