Detect if .swf has transparent background
I think you can read the .html where the .swf is placed and see if there is a parameter called "wmode" and is set to "transparent"
If that's the case you can get the html file and read it with Python, Java or PHP.
It's an ugly solution, but it's a solution.
PS: Sorry for my poor English.
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.