[mtasc] question on -keep

Kai Langenbach kai.langenbach at gripag.de
Thu Jul 7 11:24:35 CEST 2005


Hi list!

As -keep will leave the MMC-compiled(!!!) classes in the source clip 
untouched I'm asking myself how MTASC knows if a class was compiled by 
MMC or MTASC?

Is there a way to tell MTASC to keep ALL classes of the source clip (no 
matter if they were compiled with MMC or MTASC) and copy them to the 
output clip?

My idea was to 'inject' existing swf's with some classes using -out, 
-keep and -main.
Think about the admin tool connector classes for example. Let's say i 
want to add the connector classes to any exiting swf.
Every time i try this with a MTASC compiled clip all classes will be 
kicked out of the clip as they are not in my classpath.

I had some success with MMC compiled clips. Let's say i have a class 
Injector.as

class Injector {
    static function main() : Void {
        // do some stuff...
    }
}

and a source clip named foo.swf.

With "mtasc Injector.as ... -keep -main -swf foo.swf -out 
enhancedFoo.swf" the 'injected' main method will be called before the 
normal execution of the target clip.

Can anybody give me some hints how to make code injections/ehancements 
on existing swf's ???

Thanks in advance, Kai




More information about the mtasc mailing list