EOF error encountered while converting bytearray to bitmapdata

Posted by intoTHEwild on Stack Overflow See other posts from Stack Overflow or by intoTHEwild
Published on 2010-03-18T11:48:44Z Indexed on 2010/03/18 11:51 UTC
Read the original article Hit count: 762

Filed under:
|
|
|

I am using

var bitmapdata:BitmapData=new BitmapData();
var pixels:Bytearray=new Bytearray();
pixels = rleDecodePixles();
bitmapdata.setPixels(bitmapdata.rect, pixels);

In the 4th line in the code above i am getting "Error: Error #2030: End of file was encountered." I checked the length of the pixels object which is 4 times the width*height of the rect object. Given that setPixels() functions reads unsigned int from bytearray and sets that value to pixels, I think it should work.

But I have no clue why this wont work. The pixels object is filled after RLE decoding of the data which i get from a server.

Is there any work around or any other method which I could try to use. The loader class wont work as the data that I get from the server is not in any of the recognized format.

Any help is greatly appreciated.

Shrikant

Thanks.

© Stack Overflow or respective owner

Related posts about as3

Related posts about flex