Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我需要导入哪个包才能在flash中使用JPGEncoder?_Flash_Package - Fatal编程技术网

我需要导入哪个包才能在flash中使用JPGEncoder?

我需要导入哪个包才能在flash中使用JPGEncoder?,flash,package,Flash,Package,以上是报告错误: var jpgEncoder:JPGEncoder = new JPGEncoder(85); var jpgStream:ByteArray = jpgEncoder.encode(bmpData); 你在说什么 Type was not found or was not a compile-time constant: JPGEncoder. Call to a possibly undefined method JPGEncoder. 如果是的话,这是中的核心类 编辑

以上是报告错误:

var jpgEncoder:JPGEncoder = new JPGEncoder(85);
var jpgStream:ByteArray = jpgEncoder.encode(bmpData);
你在说什么

Type was not found or was not a compile-time constant: JPGEncoder.
Call to a possibly undefined method JPGEncoder.
如果是的话,这是中的核心类

编辑:据我所知,另外一种可能是预包装的

com.adobe.images.JPGEncoder; ?

不确定它与as3core库的匹配情况

谢谢!这一次我得到:
Definition com.adobe.images:JPGEncoder找不到。
如何包含核心类?您需要下载它。我在上面又贴了一次链接。仍然无法访问
com.adobe.images::JPGEncoder/encode()
:(它通过了编译,但在运行时失败。@nikc,我只是将
com
目录放在我的
.fla
所在的同一目录下。应该可以,对吗?@ieplugin我尝试了@nikc blog link,并在本地主机上运行它。在使用Flash CS3发布后,我遇到了相同的错误,并将我的com文件夹放在了同一级别上作为我的fla文件。你能列出你的Flash IDE和Flash Player版本吗?如果可能的话,试着浏览一下@nikc提供的博客示例,也许你有点过火了。你的代码是在文档类还是框架中?失败的原因是什么?运行它调试并更新问题?抱歉所有的问题。只是尝试定义一下你你的问题:)@phwd已经回答了你的问题,但是当你需要进一步的指导时,这篇博文可能会让你感兴趣:@nikc,就快到了,但我对flash真的很陌生,当我尝试导入那个软件包时,似乎缺少了一些东西。。。
mx.graphics.codec.JPEGEncoder