innogames / ax3

AS3 to Haxe converter
MIT License
43 stars 10 forks source link

[Newbie] wants to know how to use #7

Closed FlashTang closed 3 years ago

FlashTang commented 3 years ago

Hi when I run java -jar converter.jar config.json I get error promote:aaa tang$ java -jar converter.jar config.json Exception in thread "main" java.lang.NullPointerException at haxe.root.Array.ofNative(/usr/local/lib/haxe/std/java/_std/Array.hx:47) at haxe.java.Lib.array_String(/usr/local/lib/haxe/std/java/Lib.hx:102) at sys.FileSystem.readDirectory(/usr/local/lib/haxe/std/java/_std/sys/FileSystem.hx:100) at ax3.Main$Closure_walk_0.invoke(src/ax3/Main.hx:97) at ax3.Main$Closure_walk_0.invoke(src/ax3/Main.hx) at ax3.Main.walk(src/ax3/Main.hx:109) at ax3.Main.main(src/ax3/Main.hx:31) at ax3.Main.main(src/ax3/Main.hx:1) promote:aaa tang$

How to fix it ? Thanks

nadako commented 3 years ago

What's your config.json? Looks like it's missing src field :)

FlashTang commented 3 years ago

@ nadako Hi nadako , this is my config.json

{
    "src": "SOURCE/Test.as",
    "hxout": "OUT/Test.hx",
    "swc": [
        "playerglobal32_0.swc"
    ]

}

SOURCE , OUT and playerglobal32_0.swc are in the same folder with converter.jar , Test.as is in the SOURCE folder ,OUT folder is empty this is Test.as :

package  {
    import flash.display.MovieClip;
    public class Test extends MovieClip {
        public function Test() {
            // constructor code
        }
    }
}
nadako commented 3 years ago

Oh, src and hxout should be folder paths, not file paths. Sorry, this tool isn't super friendly when it comes to invalid input ^^

FlashTang commented 3 years ago

@nadako
Merry Christmas ,thank you, it works now 👍