Detect if .swf has transparent background
Flash is a bunch of compiled binary data. You Might be able to hunt down a third party library which can un-compile the flash file and get some of the data from the root movie scene, but it's a large stretch. As others have recommended, a checkbox during upload would be the best route to take.
Is there a way to do this programmatically in PHP, Python or Java?
Use case:

User uploads .swf through an upload form.
Detect if it has a transparent background.
If it does, change it to something else, e.g. white.