radikalFX

About

RadikalFX is the personal outlet of Berry de Vos. This is the place were I write about the technology that I come across and stuff I have discovered on the inter tubes. More...

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:

Using the External API for Flash–JavaScript Communication

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;
Leave a Reply