tags:

views:

24

answers:

1
var jpgEncoder:JPGEncoder = new JPGEncoder(85);
var jpgStream:ByteArray = jpgEncoder.encode(bmpData);

The above is reporting error:

Type was not found or was not a compile-time constant: JPGEncoder.
Call to a possibly undefined method JPGEncoder.
+1  A: 

Are you talking about

com.adobe.images.JPGEncoder; ?

If so,This is from the core classes in ActionScript 3 Core Library.

Edit : The only other I know of that may come prepackaged is

mx.graphics.codec.JPEGEncoder

Not sure how it matches up to the as3core library

phwd
Thanks! This time I get: `Definition com.adobe.images:JPGEncoder could not be found.` How to include the core classes?
ieplugin
Well you need to download it http://code.google.com/p/as3corelib/ I posted the link above here it is again.
phwd
Still can't access `com.adobe.images::JPGEncoder/encode()` :( It passes compilation but fails at run time.
ieplugin
Are the files you downloaded in your classpath?
nikc
@nikc, I just put the `com` directory under the the same directory my `.fla` is in. That should work, right?
ieplugin
@ieplugin I tried @nikc blog link and got it running on my localhost after publishing with Flash CS3 I encountered the same error and placed my com folder on the same level as my fla file. Could you list your Flash IDE and Flash Player version also if possible try to go through the blog example that @nikc provided maybe there is something you are over-looking. Is your code in a Document Class or a Frame ? What is the failure ? Run it debug and update the question? Sorry for all the questions. Just trying to define your problem :)
phwd
@phwd, I have some progress after your help,thanks!
ieplugin