Javascript to ActionScript Communication with ExternalInterface
Click to Send Variable
Download the FLA used here