Knowledgebase
FlashDecompiler.com > Manitu Group Support > Knowledgebase

Search help:


Does AS3 Class Replacer tool have a help file?

Solution

AS3 Class Replacer toolfor ASV currently does not have a help file or documentation. You can refer to this article for more information.

What does AS3 Class Replacer tool do?

It replaces a class in an AS3 SWF file, with a class (with the same name) in an another SWF file.

Sometimes rebuilding/recompiling a SWF file is not an option and/or  produces undesirable results. If all you need to do is making a few changes in one or two classes, AS3 Class Replacer tool may help.

Limitations and Notes

  • Source and target qualified class names must match exactly.
  • Works on 1 class at a time. If you need to replace 2 classes, you can do it by replacing classes one by one.
  • Works on class level. It cannot replace a single function. You will need to provide whole class with just one function modified if all you need is changes in one function.

How to Create a Modified Class

Usage of the tool itself is fairly easy, you open source and target SWF files, choose the name of the class, save as... the modified SWF file. Hardest issue will be having the source SWF file with the "modified class" compiled.

ASVs decompilation results should help here. The trick is, while you will need to have the replacement source class compiled completely, functions/classes referred by the class need not be. You can just comment out lines that produce compile errors (if there are such lines) in the classes you are not interested in.

Below is step by step instructions to compile scripts only with the help of ASV and Flash, to generate the source class compiled in a SWF:

1- Open the target SWF in ASV.

2- Execute File|Export Rebuild Data command (or press F4), select an empty rebuild folder (for example desktop\rebuild)

3- Execute Utility|SWF Information (or press F6), take note of the Document class name

4- Modify the script files (.as) in the rebuild folder using a text editor, as needed.

5- Run Flash, create a new AS3 FLA document

6- Save the FLA in the rebuild folder's root. (for example as desktop\rebuild\source.fla)

6- Click on the first frame, open actions panel, enter the actionscript:

import [document classname here];
[document classname here];

for example:
import target_fla.MainTimeline;target_fla.MainTimeline;

(or, if you have modified only one class, you can use that class name here)

7- Save the FLA and export SWF (Ctrl+Enter).
The exported SWF (for example desktop\rebuild\source.swf) will contain the modified classes, you can use this SWF as source SWF in AS3 Class Replacer Tool.

8- In AS3CR tool, open the source SWF and original target SWF, select the modified class name and click Save SWF as button. For each additional modified class, open the saved modified SWF as target, select the next class name and click save button again.

Technically only ScriptInfos (which normally correspond to an AS file, in a DoABC SWF tag) with a single trait of type class are supported. (It is possible that in the future this restriction is relaxed, but we will require a completely similar structure of source and target ScriptInfos. This tool works on ScriptInfos, rather than individual class traits. Merged ScriptInfos/doABC tags are separated and then re-merged).

 

 
Was this article helpful? yes / no
Article details
Article ID: 8
Category: ASV
Date added: 2014-09-01 15:33:11
Views: 505
Rating (Votes): Article rated 3.2/5.0 (25)

 
« Go back

 
Powered by Help Desk Software HESK, brought to you by SysAid