Building Flash Applications (possibilities)

I want to write applications in flash. Full blown ones, that have access to all ports (serial and USB especially). What can I do?

Right now I’m thinking pretty much nothing, right? I mean, I can build a standalone movie, but it can’t influence the outside world - other than through web programs like javascript or php.

I want flash to work like Java (not javascript), in a way. For example, I’m programming a robot with Java. The Java app comes up, you interface with the robot through the serial port. This is relatively easy in Java, can it be done at all with a flash application?

Just spouting I guess, but it’s something I’ve wondered about for some time.