PDA

View Full Version : PNGEncoder Problem



jazzman121
October 15th, 2008, 11:48 PM
hey! im having a weird issue

when i use PNGEncoder from adobe
I get this error

here is my code



var bmd : BitmapData = new BitmapData( maskMC.width, maskMC.height, true, 0x00000000 );

bmd.draw( ContainerMC, new Matrix(), null, null, null, true );

var byteArray : ByteArray = new PNGEncoder.encode(bmd);


Im getting this error

1048: Method cannot be used as a constructor.

Any idea why?
Thanks

Jeds
October 16th, 2008, 12:16 AM
change this line
var byteArray:ByteArray = new PNGEncoder.encode(bmd);

to


var byteArray:ByteArray = PNGEncoder.encode(bmd);

gdog
October 16th, 2008, 05:37 AM
encode() is a static function

jazzman121
October 16th, 2008, 10:04 PM
thanks for ur help guys.. that worked :)