After dealing with this situation for about two hours, I have decided to blog this so that you will easily implement your own code into your web page.
First of all calling events for buttons in flash has changed a little in Actionscript 3. The new code to implement event is as the following…
btnA.addEventListener(MouseEvent.CLICK, onClickbtnA);
function onClickbtnA(event:MouseEvent):void
{
ExternalInterface.call("funct(\"E3A\")");
}
At the example above, btnA is the name of the button and funct(string) is the name of the javascript function in the page. addEventListener function is the new way to implement events in Actionscript 3.
That’s it. When you click btnA the “funct” javascript function will be triggered.
Popularity: 4% [?]
Tags: Actionscript, Actionscript 3.0, addEventListener, Adobe Flash CS3, Flash, Javascript