EOF error encountered while converting bytearray to bitmapdata
- by intoTHEwild
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.