You can try to search about how to create that script with JSFL files.
.fla files are proprietary. It would be very difficult to create them on the fly, they need to be created from within the flash interface. There are other programs that create .swf files too, but again from within the interfaces.To automate a file creation from outside of the API is a faily complex task. You would need to create and compile a full executable program, probably C, C++ etc.
You do not need to create a .swf for font variations such as size, or one for each for that matter, size and style is a rendering issue not an embedding issue, that seems a very bloated way to do it, again if your using many at once. If you know your going to be using multiple fonts and variations, it is much simpler to change the size/style at runtime with with AS, and XML as long as the base font and character package is available. You might be better off just creating one .swf with each font package to begin with, yes a little more work to create each package, but once done it will never need to be done again, then it is a very simple process of embedding them or changing them with dynamic text boxes as needed at runtime, with very simple scripting. I don't understand why you would need all that programming to essentially create a file once. After that all that automation is useless. You would not need to create it again.
Application has a fontStyle manager. The application never (outside of debugging purposes) creates textfields by itself. All textfields used to display text are created by a call to the fonts manager, like "fontsStyleManager.createFont("header1");"
As such, each fontStyle has an associated font SWF and other textField parameters. The website owner can specify which particular font SWFs are to be loaded at start, and all unused font SWFs are highlighted, to be deleted of the list.
2. Flash font embedding sucks
Flash embedding sucks. I've had whole projects refuse to compile and not even display any messages. I had fonts that changes sizes and font faces. I've had fonts not embed at all, even though I specified explicitly for them to be included. Embeding by code and at runtime is cleaner, and it works
Embedding fonts from Flex embeds all European characters including German, Greek, Norwegian and so on.. except Polish. In here I can specify my own precise character set using the flash IDE.
4. Fonts in Flash are complicated
Normal, vector fonts are embedded easy. Size doesn't matter, as the font can clearly scale to any size and remain nicely anti-aliased. Embeding a Bold style doesn't mean yhou embed a Regular. Bitmap fonts are embeded by font size, that is, embeding a 14px bitmap won't make it possible to use a 16px. In addition, embedding a Bold doesn't embed a Regular bitmap font. What's interesting is that you can take a 12px embed font and set the TextFormat to, say, 22px, and get a very interesting-looking pixel effect, as the font gets scaled up.
5. Flexibility - the ability to see a completely different set of fonts in your project without having to recompile - priceless.
Again once runtime font packages are created as .swfs for use in Flash/Flex and .as docs, regardless of size style bitmap or vector etc, you should never need to create them again. Why would you delete them and not just code them to be removed from the display list. Why would you not want the ability to reuse a package? And/or create it each time you need it? Just my opinion, but that just seems resource consumptive and unneccessary. Makes no sense to me.
But, if you want that for whatever reason, you will need to create an executable program in a high level programming language.
Well, the basic idea is that it is reusable. Once-created font SWFs can be used in each and every project using the manager. Although a load of SWFs will be present on the server, the site admin chooses which fonts are actually loaded.
The question is how to creare the hundreds of fonts. For example each style of a font (that is, for example italic, strong, bold, however it's named) requires 1 non-bitmap font and bitmap fonts from 8px to 20px - 13 swfs for one style. Tahoma for example has 4 styles: Regular, Italic, Bold, Bold Italic. That means 52 SWFs, and only for one font!
I want a way to automatically create those SWFs.
I wish I had a magic bullet for you. The only way I know of is to either create each swf manually, or create an executable. In my mind, simply because I do not know high level languages, I would just start banging out the swfs. To me it's the easiest way, lot of work granted, but it is the only solution I would have without someone building the .exe for me.