1

My workflow usually goes like this: i create a symbol in Flash IDE with textfields, containers, etc. Then I select "export for actionscript" and type in the classname (automatic declaration of stage instances, of course, is off).

Then i create a corresponding classfile in FDT and declare all this textfields and other objects that are in my symbol. This is pretty routine and boring process that takes a lot of time.

Is there a way to automate it? Maybe some plugin for flash IDE that will automatically create a class file based on symbol exported for AS?

Update: So, following the answer Pavel fljōt provided, i wrote my own command to accomplish this task. It is now available on Adobe Exchange here: http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=3021022

DataGreed
  • 13,245
  • 8
  • 45
  • 64
  • The nearest extension to what i want is LazyBoy, but it seems to be broken (http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1860528) – DataGreed Mar 14 '12 at 12:46
  • How are you including these symbols in your project? Are you using [Embed] tags perchance? – grapefrukt Mar 14 '12 at 13:09
  • Of course no, I just create a class for a library item. That's it. – DataGreed Mar 14 '12 at 13:40
  • But you are getting these assets into FDT somehow, can you describe how you are doing that? – grapefrukt Mar 14 '12 at 16:06
  • Can't you use "automatically declare stage instances?" Why bother doing it all by hand? – weltraumpirat Mar 15 '12 at 00:06
  • grapefrukt, I use fla to publish and FDT to write code. In some ways it's more comfortable than compiling in FDT. – DataGreed Mar 16 '12 at 09:00
  • weltraumpirat no, I can't use "automaticaly declare stage instances" because it's implicit and FDT or any other code editor won't introspect class fields and use them in code assist and type checking. It's like turning off "strict as3" - there is an option but it doesn't mean that it is comfortable and someone really should use it. – DataGreed Mar 16 '12 at 09:03
  • @DataGreed Wouldn't it be more logical to compile just all of your graphical assets into an SWC and use FDT to compile the project and manage class files? I can't agree with you, btw - the flex compiler is so much faster, especially with incremental builds, that it would be a major pain in the butt to use a FLA for compilation. – weltraumpirat Mar 16 '12 at 18:22
  • @weltraumpirat sorry, but, in my turn, i cannot agree with you. My workflow involves constant work with a UI designer and a designer (sometimes it is myself), so if I will recompile assets in the SWC's everytime I change them, then i will have no time to actually code, because it takes really lots of time to compile them everytime. And compiling assets in swc - that's what is a real pain in that part of the body :) – DataGreed Mar 17 '12 at 13:06
  • @weltraumpirat I also understand that some kind of assets can be edited visually in Flash Builder (Flex Builder), but I don't like Flash Builder itself - it not as comfortable to work with as FDT. And FDT does not have a visual UI design view :( And btw, compiling in swc doesn't cancel my question at all - i still have to generate class files :)) – DataGreed Mar 17 '12 at 13:08
  • The difference is that you don't have to generate boilerplate classes - the Flash IDE will do that. I also don't see why compiling the whole project should be more effective than compiling only those parts that actually changed. You could even split up your one big SWC into several smaller ones to streamline the compilation process. But hey, suit yourself. I use FDT myself, and I would go crazy if I had to open up the Flash IDE every time I want to compile. – weltraumpirat Mar 17 '12 at 13:26
  • What makes you think I open Flash IDE to compile? I mean, of course it is opened once (I don't ever shut down my mac), but I don't switch to it to compile. My FDT run properties a set to automatically publish through IDE when i press cmd+F11 in FDT – DataGreed Mar 18 '12 at 19:52

1 Answers1

2

You could use JSFL to work with .fla library. You can write a script that runs through library items, finds the ones exported for AS and creates .as file you need (if it's not created yet, not to overwrite your existing one for instance). (To create public properties you got to run through objects on symbol stage, grab their names and types to create appropriate fields in your class).

Worth to mention the great framework xJSFL, which can really help you to write more compact and elegant scripts.

average dev
  • 1,128
  • 7
  • 22
  • Well, i thought that maybe there already is an extension. I actually just started writing my own one. Thanks for the link to xjsfl - I didn't even think that there are frameworks for jsfl :) – DataGreed Mar 14 '12 at 16:20