Quick JSFL: Component Code Generation

When creating new forms, the repitition of defining the form buttons and then attaching them in my init function gets old, quick. Until I update my Class Creator, here’s the next best thing using JSFL. You type in your component’s name (ex: cancel_pb), and click OK, then type in your class name (ex: mx.controls.Button), type in your class’s symbol name (ex: Button), and it’ll put the code you need in the Output window. If you don’t hit cancel (or leave a field blank), it’ll keep going. Save as a JSFL file, preferably in your Commands folder so you can re-use it.

Read on for code…