Using the External API for Flash–JavaScript Communication

http://www.adobe.com/devnet/flash/articles/external_interface_print.html