Copy link to clipboard
Copied
This question was posted in response to the following article: http://help.adobe.com/en_US/as3/dev/WS4768145595f94108-17913eb4136eaab51c7-8000.html
Copy link to clipboard
Copied
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);
}
}
}
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now