as2 export fix, as2 edit fix (prefix, suffix problem)

This commit is contained in:
Honfika
2013-11-01 15:01:34 +01:00
parent 9b5acbcaee
commit 6d264576e4
12 changed files with 124 additions and 63 deletions
@@ -22,7 +22,7 @@ import com.jpexs.decompiler.flash.RunnableIOEx;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.helpers.HilightedText;
import com.jpexs.decompiler.flash.helpers.HilightedTextWriter;
import com.jpexs.decompiler.flash.tags.CSMTextSettingsTag;
import com.jpexs.decompiler.flash.tags.DefineButton2Tag;
import com.jpexs.decompiler.flash.tags.DefineButtonCxformTag;
@@ -1112,8 +1112,11 @@ public class XFLConverter {
}
private static String convertActionScript(ASMSource as) {
HilightedText decompiledAS = Action.actionsToSource(as.getActions(SWF.DEFAULT_VERSION), SWF.DEFAULT_VERSION, as.toString(), false, as.getActionSourceIndent());
return as.getActionSourcePrefix() + decompiledAS.text + as.getActionSourceSuffix();
HilightedTextWriter writer = new HilightedTextWriter(false);
as.getActionSourcePrefix(writer);
Action.actionsToSource(as.getActions(SWF.DEFAULT_VERSION), SWF.DEFAULT_VERSION, as.toString(), writer);
as.getActionSourceSuffix(writer);
return writer.toString();
}
private static long getTimestamp() {