views:

629

answers:

2

I have a program consisting of multiple SWF's. An AS2-SWF loads a bunch of AS1-SWFs. It's a crappy program. I'd like to specify the GUI in MXML and perhaps refactor some code to AS3. However, converting all of the 300+ symbols to AS3 or whatever is undoable.

What are my options in converting to AS3/Flex/MXML? The app is very simple, only also quite large. It consists only of buttons, backgrounds and attention-texts. All the button texts are in XML files.

I want to turn this into pretty code ASAP but also controlled so the code becomes:

  1. easily updateable/maintainable,
  2. readable
  3. learnable (so I can have the updating done by someone that can only script AS3 or even MXML).

Of course doing this is on my own initiative, if it'll take more than a week, I won't be able to find the time.

Regards, Jurgen

A: 

Jurgen, I feel for you... it sounds like a lot of work.

What sorts of issues do you have? are all the swfs treatable as different classes? is there much overlap in the logic or does each object have a specific role?

I think having so many different SWFs may possibly lead to scoping problems> which swf talks to which. you may be able to set up something with as3 that uses the existing parts and then try making a facade over the existing code > use the existing logic in the swfs and do the visual part through mxml. other than that, all I can advise is a rebuild. you might find yourself in need of a swf decompiler too if you are missing some of the original fla's

Assembler
+1  A: 

This might help:

http://flexman.info/2009/03/29/as3converter-an-ant-task-small-collection-of-as3/

It's mainly for AS2 code, so FLA editing is out of the question. But you should certainly look into JSFL.

There are some pretty good scripts out there already dealing with something like this:

http://bumpslide.com/blog/2009/03/07/jsfl-class-generator/

What this command does is that it looks through your library and finds all library items that have a custom linkage class name. If the class extends flash.display.MovieClip (or if the base class is blank), it checks to see if a classfile exists, and if not, it creates it for you. When it does this, the script looks at all the items on the timeline and adds relevant properties to your class. If these clips are instances of other components, they will be typed as such, and relevant import statements will automatically be added to your class. If your component is set to extend some other class (for instance, com.bumpslide.ui.Button), no class will be generated. Class files will be written to the correct package location inside the first custom class path defined in your publish settings.

Hello,Thanks for both your replies, they're very helpful. My main gripe is the AS1 code that is all in the .fla file. It's impossible to search through rapidly, which costs a lot of time.
JurgenW
The first link you posted, Ramsey, looks useful, however the download location isn't valid anymore. It links to a page that has three files, none of which is the conversion program. I'll look into reverse engineering the swf so maybe I end up with a bunch of almost-readable AS files.
JurgenW
I'll try that JSFL tool as well. I think it's very likely i'll get huge scoping problems because objects that have their code in different swf's talk to each other by using the _root object =/ Or the stage object. Or just strings that may or may not refer to an object :-(
JurgenW
JurgenW