Compressing bitmap data
this question posted in response following article: http://help.adobe.com/en_us/as3/dev/ws4768145595f94108-17913eb4136eaab51c7-8000.html
i'm afraid nothing can given example work, using either jpg encoder or png encoder, whether in <fx:script entity, or in external class. gives 1 of 2 following errors (based on , how instantiate encoder options object)
referenceerror: error #1065: variable flash.display::pngencoderoptions not defined.
and
verifyerror: error #1014: class flash.display::pngencoderoptions not found.
/* more verbosely */
referenceerror: error #1065: variable flash.display::pngencoderoptions not defined.
at classes::pngencoder()[d:\dropbox\work\picturetools-onthemove\picturetools-onthemove-makei t\src\classes\pngencoder.as:12]
at components::choosepicturebutton/choosepicturelightboxclosed()[d:\dropbox\work\picturetool s-onthemove\picturetools-onthemove-makeit\src\components\choosepicturebutton.mxml:165]
here's class i'm using, though represents 1 iterative attempt of dozens , dozens.
package classes
{
import flash.display.bitmapdata;
import flash.display.pngencoderoptions;
import flash.geom.rectangle;
import flash.utils.bytearray;
public class pngencoder
{
public function pngencoder(bmpdata:bitmapdata, png:bytearray, fast:boolean)
{
bmpdata.encode(new rectangle(0, 0, bmpdata.width, bmpdata.height), new flash.display.pngencoderoptions(fast), png);
}
}
}
More discussions in ActionScript 3
adobe
Comments
Post a Comment