Ming is an opensource library for generating .swf (ShockWave Flash) files. This howto, will deal with using Ming to create a basic Flash file.
I have generated Flash using the Flash studio, whilst working primarily on the windows platform for development, many moons ago. Now that I tend to use unix systems for development I thought I would look into what is on offer on the unix platform. Ming is the first library that comes to mind. There is Cairo another vector image library, and Inkscpae for GUI generation of SVG (Scalable Vector Graphics) which hopefully should be easy to include and then manipulate using the libraries, well that is the plan :).
First thing is to get hold of the ming library itself.
I am using Gentoo as my development machine so it is a simple:
If you are not on gentoo, then your package manager should have the ming library, if not you will have to go to the source.
We will need some font files as well. These can be found at Sourceforge Ming Fonts.
If the font files don't work, and they didn't for me (1 appeared as a B), then get the example file there is a test.fdb file in there.
Ming is a C library, though there are wrappers allowing it be used in:
The wrappers can be found at sourceforge.
Whilst, the Python module does look tempting I am going to use C for this first demo.
Create a working directory perhaps called ming. Then fire up your favourite text editor, for me it is vim, and let's edit a file called demo1.c.
Once we have the file in place, we need to compile it then run it to generate the demo1.swf file. I have left the printf num in there, though you could remove it.
Once we have the code working, and a demo1.swf file we can then embed the flash file in a page, like so.
The object with param and embed are both used to allow both Netscape and IE browsers to see the file.
Ming is quite a quick way of producing Flash files. Oddly scripting in C is not awkward, as one does not have to make the program bullet proof. The program is really just a script tool on top of the library. Though of course, it's generally easier to script in a higher level language, so I will probably be using Python to produce further demos.
The font issue did affect the speed of production, limited fonts could be a deal breaker as well. I will look into Cairo for production of the movies, and using Ming to produce the output, that may be a good toolchain.
Poised Solutions is a UK, Thames Valley based IT Consultancy. If you wish to discuss hiring Poised Solutions for IT Projects, please get in contact.