0

I am planning editing someone else's fla project (I do not have contact with them, trust me. And no I'm not trying to steal their code.)

The project ran fine as a swf, but when I load the fla and try to test it I get an error that don't really understand.

I checked and it seemed like everything was correct; no missing semicolons, no missing brackets, no spelling mistakes. I also looked up the issue and found people with similar errors but much different code, making it hard for me to understand the solution. I used to be pretty good with ActionScript, but I have not used it in a long time and have gotten pretty unfamiliar with a lot of things.

            if (!this.patchFailed)
            {
                try
                {
                    var _loc_2:* = this.patchLoader.content;
                    data = _loc_2.this.patchLoader.content["patch"](data);
                }
                catch (error:Error)
                {
                    trace("[mochicrypt] patch failed", error);
                }
            }

The error that I'm getting is a result of "data = _loc_2.this.patchLoader.content["patch"]"

The swf I extracted this from worked fine, like I said, but in here it gives this error and the swf is just the canvas color. I am using Animate CC 2017 and the swf was made in AS3.

The exact error says, "1084: Syntax error: expecting identifier before this."

Brian
  • 3,850
  • 3
  • 21
  • 37
  • 1
    It's a decompiled project, which was, most probably, obfuscated (protected against decompilation) as SWF. Which means you can get any number of cases like this and there's no general knowledge how to fix it. Your only option is to study the project's code as a whole and understand what these pieces were supposed to do - then fix them. – Organis Apr 18 '19 at 23:04
  • 1
    Apparently, mochicrypt was a code encryption library mostly used for online games. It looks like there are tools to undo the mochicrypt layer, but if you have the .fla, that shouldn't be necessary you can just edit the code! Based on the code snippet, my naive answer would be "delete '_loc_2' from the line you quoted", but that's likely to have side effects in code you *haven't* included here. – Brian Apr 24 '19 at 15:15

0 Answers0