Is there a python library that will let me programmatically control a flash animation?

I would like to use those 2 technologies together. I want to have the program I wrote in python to talk to ActionScript so that I can direct an animation frame by frame. If python/flash isn't the answer, is there some other combination that will allow this? ActionScript alone won't work I don't think, because I need whatever controls the animation to also be able to talk to a serial port and a printer.

Maybe this is the wrong forum for this, but I know this is possible in windows so I thought I'd ask you linux gurus and see if you can prevent me from going back to XP.