Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Compressing bitmap data

Explorer ,
Jan 23, 2013 Jan 23, 2013

This question was posted in response to the following article: http://help.adobe.com/en_US/as3/dev/WS4768145595f94108-17913eb4136eaab51c7-8000.html

TOPICS
ActionScript
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 23, 2013 Jan 23, 2013

I'm afraid that nothing I do can get the given example to work, using either the jpg encoder or the png encoder, whether in an <fx:Script entity, or in an external class. Always it gives one of the two following errors (based on where and how I instantiate the encoder options object)

ReferenceError: Error #1065: Variable flash.display::PNGEncoderOptions is not defined.

and

VerifyError: Error #1014: Class flash.display::PNGEncoderOptions could not be found.

/* more verbosely */

ReferenceError: Error #1065: Variable flash.display::PNGEncoderOptions is not defined.

at classes::PngEncoder()

at components::ChoosePictureButton/choosePictureLightboxClosed()

Here's the class I'm currently using, though it represents only one iterative attempt of dozens and 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);

}

}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 24, 2013 Jan 24, 2013

Hi,

Can you please confirm that you're using Flash Player 11.3 (or AIR 3.3) or higher?  If you're using Flash Builder, go to Project>Properties>ActionScript Compiler and under Adobe Flash Player options ensure that "User a specific version" is selected and that it specifies 11.3.0 or higher.

Regards,

Randy Nielsen

Senior Content and Community Manager

Adobe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 22, 2013 Mar 22, 2013

I am also facing this problem, using Adobe AIR 11.5, confirmed due to Capabilities.version. Getting the exact same errors, it compiles fine but at runtime it refuses to acknowledge the existence of the class whenever it's instantiated. Really annoying. Happens in the debug player and even if you install the application and run it normally (just without the error, it just does nothing).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2013 Mar 22, 2013

i don't see that problem.

when testing with air 11.5, you see an error?  if yes, attach a screenshot of the error with "permit debugging" enabled.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 22, 2013 Mar 22, 2013
LATEST

Okay it turned out that -swf-version wasn't set high enough, I changed it to -swf-version=18 and it fixed everything. Although it's still weird that everything else was reporting that I was indeed on 11.5. Oh well, at least it's solved.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines