Take a look at the ExternalInterface-Class.
From the AS3-Language Reference:
The ExternalInterface class is the
External API, an application
programming interface that enables
straightforward communication between
ActionScript and the Flash Player
container– for example, an HTML page
with JavaScript. Adobe recommends
using ExternalInterface for all
JavaScript-ActionScript communication.
And it's work like this:
ExternalInterface.addCallback("sendToActionScript", receivedFromJavaScript);
ExternalInterface.call("sendToJavaScript", input.text);
You can submit parameters and recieve callbacks...pretty cool, right? ;)
As I know it will also work on AS2...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…