What is wrong with my JPGEncoder
        Posted  
        
            by 
                hitek
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by hitek
        
        
        
        Published on 2012-06-23T14:09:46Z
        Indexed on 
            2012/06/23
            15:16 UTC
        
        
        Read the original article
        Hit count: 254
        
actionscript-3
Here is my code
     if (event.target.content is Bitmap)
{
    infotext.text = "got something";
    var image:Bitmap = Bitmap(event.target.content);
    var bitmapData:BitmapData = image.bitmapData;
    this.addChild(image);
    var j:JPGEncoder = new JPGEncoder(100);
    var bytes:ByteArray = new ByteArray();
    bytes=j.encode(bitmapData);
}
else
{
    throw new Error("What the heck bob?");
}
When I run a debug session everything works fine till it reaches to the line
      bytes=j.encode(bitmapData);
after that nothing happens and my program just goes into limbo Please help
© Stack Overflow or respective owner