2010-07-02 36 views
2
var jpgEncoder:JPGEncoder = new JPGEncoder(85); 
var jpgStream:ByteArray = jpgEncoder.encode(bmpData); 

以上是报告错误:我需要导入哪个包才能在Flash中使用JPGEncoder?

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

@phwd已经回答了你的问题,但是当你需要进一步的说明,这个博客文章可能会让你感兴趣:http://henryjones.us/articles/using-the-as3-jpeg-encoder – 2010-07-02 17:16:12

+0

@nikc,几乎在那里,但我真的是新的闪光,似乎有什么东西是失踪时我尝试导入那个包... – ieplugin 2010-07-02 18:03:15

回答

3

你说的是

com.adobe.images.JPGEncoder; ? 

如果是这样,这是从ActionScript 3 Core Library的核心类。

编辑:唯一的其他我所知道的是可能会预包装是

mx.graphics.codec.JPEGEncoder 

不知道如何匹配到as3core库

+0

谢谢!这次我得到:'定义com.adobe.images:无法找到JPGEncoder.'如何包含核心类? – ieplugin 2010-07-02 17:07:36

+1

那么你需要下载它http://code.google.com/p/as3corelib/我发布了上面的链接,这里再次。 – phwd 2010-07-02 17:08:35

+0

仍然无法存取'com.adobe.images :: JPGEncoder /编码()':(它通过编译,但在运行时出现故障。 – ieplugin 2010-07-02 17:34:57

相关问题