Whereas the Flash Player is not open sourced, the .swf file format itself is publicly available (which is one reason it has garnered a lot of third-party support). For further information, here are some resources:
http://www.macromedia.com/software/flash/open/licensing/fileformat
Here you can obtain the SWF SDK from Macromedia, "a set of tools for developers to write Macromedia Flash (SWF) files, documentation of the Macromedia Flash file format (SWF), and code to write SWF files."
A general information center for developers of SWF implementations. Includes tutorials, message boards, resources, and source code.
An open source C library for generating SWF format movies, plus a set of wrappers for using the library in C++ and popular scripting languages such as PHP, Python, and Ruby. See http://www.opensource.org for information on open source software.
http://www.2shortplanks.com/flash
A Perl library to allow the "dynamic, programmable generation of Flash/SWF movies." Created by Simon Wistow.