You need to look at the documentation for ExternalInterface, which provides a link between JavaScript and Flash on a web page.
The basics run along the import lines of a library in Flash:
import flash.external.ExternalInterface;
, Javascript, addCallback():
ExternalInterface.addCallback('stopVideo', stopVideo);
function stopVideo() {
...
}
, stopVideo() - -.
Javascript Flash call():
ExternalInterface.call('updatePlayerInfo', "STOPPED");
Javascript- updatePlayerInfo() 'STOPPED'.
AS3 ExternalInterface , AS2, AS2.