swf is a the Macromedia Flash (Now Adobe Flash) file format.
You can donload the specifications from Adobe.com I guess.
Normally you use a high level language such as ActionScript and a program to generate movies, but you can generate the SWF byte codes in perl, php or C and add JPEG images etc. (been there done that)