我使用 JPEXS Free Flash Decompiler 10.0.0 反编译了 *.swf 文件
要添加新功能,请将字符串保存到文本文件
代码:
package
{
...
import flash.filesystem.*; // my code
public class NewSocket extends SecureSocket
{
....
public function send(param1:String) : void
{
// my code
var file : File = File.desktopDirector.resolvePath("your_file_name.txt");
var fs : FileStream = new FileStream();
fs.open(file, FileMode.WRITE);
fs.writeUTFBytes(param1);
fs.close();
// my code
...
}
...
}
}
我收到消息“不是字符串类型……”
这个字符串
var file : File = File.desktopDirector.resolvePath("y our_file_name.txt");
检查 Flash CS6
import flash.filesystem;
我没有这个库
adobe AIR 已安装
如何解决这个问题
谢谢!
最佳答案
Flash CS6 > 菜单"file">“发布设置”。
右上角有一个“目标”下拉列表。您应该选择一个带有 AIR int it 的选项,否则 AIR 类将不可用,并且 Flash 将不会编译使用 AIR 类的代码。
然后,您将导入类,而不是包:
// Import one class.
import flash.filesystem.File;
或
// Import all the package classes.
import flash.filesystem.*;
关于actionscript-3 - 增加反编译*.swf文件的新功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42179220/