Detect if .swf has transparent background
This is very difficult to determine, because all SWFs are actually transparent (or they all can be) - it's just that they can contain shapes which cover the entire stage, which make them appear non-transparent.
To determine this programmatically, you'd need to loop over every shape in the SWF and look at it's bounds. However, that wont be enough since any shapes can be changed by ActionScript blocks and new shapes can be created at run time.
But really, making them transparent is the hard task. Since you want to make sure they're are non-transparent, you can just deal with this at display time - put a colored div behind the object or embed tag.
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.