actionscript 3 - Import classes from SWF into Flex app without starting the imported SWF -


background

i write ai flash game, , part of want train image recognizer elements of game. in order that, first want generate many samples various configurations can used training data.

in generating process have use game have in swf format. conception create own flash app accesses game swf , uses classes generate images (i have reverse engineered game swf tool, hence know classes need).

question

i created mxml file following content:

<?xml version="1.0"?> <s:windowedapplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"                        xmlns:mx="library://ns.adobe.com/flex/mx">     <fx:script><![cdata[         public function onload():void {             var clazz:class = loader.loaderinfo.applicationdomain.getdefinition("com.game.foo") class;             // here use clazz         }         ]]></fx:script>     <mx:swfloader id="loader" source="game.swf" complete="onload()" /> </s:windowedapplication> 

the problem when game.swf loaded, main movieclip started automatically, constructor invoked before onload() event handler. since environment different game expects, constructor fails exception , onload() never called.

so ultimate question how achieve game.swf not started when loaded, looking other suggestion or solution different described above.

the solution modify byte code in swf files using ffdec, , remove failing part main movieclip's constructor.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -