[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Flex AS3 image Compression

Posted on 2014-07-15
Medium Priority
Last Modified: 2014-07-16
I'm trying to compress BitmapData using the following:
myBitMapData.encode(new Rectangle(0,0,640,480), new JPEGEncoderOptions(80), byteArray);

Open in new window

I have imported the class using:
import flash.display.JPEGEncoderOptions;

Open in new window

But no matter what I try i keep getting the following error at runtime:
ReferenceError: Error #1065: Variable flash.display::JPEGEncoderOptions is not defined.

Any suggestions?
Question by:RenAndStimpy
LVL 19

Accepted Solution

Gary Benade earned 2000 total points
ID: 40198670
Since this error is occurring at runtime and not compile time the culprit is most likely your flash player version

JPEGEncoderOptions was introduced in Flash Player 11.3, so make sure your project is compiling with the  correct minimum SDK settings. You should be using at least Flex 4.6 SDK

It's worth checking your project XML namespace:
<application xmlns="http://ns.adobe.com/air/application/3.5">

If you are using a loader like SWFObject, make sure it is set to the correct flash player settings too


Author Comment

ID: 40198715
Yes thank you.

Adding this to the additional compiler arguments fixed the issue:

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question