Skip to main content
이 주제는 답변이 닫혔습니다.

1 답변

January 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);

}

}

}

jrunrandy
Inspiring
January 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

Participant
March 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).