2017-02-11 39 views
2

我反编译* .swf文件,与JPEXS免费的Flash闪客10.0.0反编译添加新的功能* .swf文件

添加新funtion,字符串保存到文本文件

代码:

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”);

入住闪存CS6

进口flash.filesystem;

我没有这个库

Adob​​e AIR在instaled

我该如何解决这个问题

谢谢!

回答

2

Flash CS6>菜单文件>发布设置。

Flash CS6 Publish Settings

在右上角有一个目标下拉列表。您应该使用AIR int选择一个选项,否则AIR类将不可用,并且Flash将不会编译使用AIR类的代码。

然后,你要导入类,不包:

// Import one class. 
import flash.filesystem.File; 

// Import all the package classes. 
import flash.filesystem.*; 
+0

@ ArtGrek13编辑。 – Organis

+0

要在JPEXS Free Flash Decompiler中使用flash.Filesystem.FileStrem,您必须写入大写字母。谢谢! – ArtGrek13