3
Apr
Communication between Flash and Javascript
Today I spend some time looking at the best way to communicating between a Flash Object and the Javascript in the page containing the Flash Object. After seeing a lot of out of date solutions I came by this article from Adobe:
It makes it really easy to do the communication between the two technologies by using the following code in Flash
import flash.external.*; // The name of a JavaScript function to call var callJasFunction:String = "callJavascript"; //parameter var msg:String = "Hello. ^^"; // The return value after calling JavaScript var returnValue:String = ExternalInterface.call(callJasFunction, msg).toString(); return_txt.text = returnValue;
