In one of the project we are working on, It requires to do communication between Flash Application (embedded SWF object in the HTML) and the ActiveX control in IE. There are various ways to do communication between a flash object and ActiveX control. Most known method to do such communication is External Interface, If we are talking about Action Script 3 and not previous versions of Action Script.

Embedding a Flash object in a HTML document and embedding it in to a .net application are very different cases. While you are integrating Flash object with Microsoft application development environment, You can drag the Flash object in to the application and can create an instance to deal with it further. While to do the same thing within HTML page instead of application, It’s slight different thing. Here in HTML case, you get instance of Flash object as some variable but you can not do the communication between external environment and flash application as you can do it in normal desktop application.

For example, You can not receive response of function calls you made to parent application as events. If that is desktop application, you can call some functions in parent applications and receive the response as event whenever the application perform desired task at application level and give you result as an event. So, If you are dealing with external communication between flash object and other ActiveX objects embedded in HTML page – you can not do asynchronous communication. So, If ActiveX object is performing long process, You might get an error of “Flash script is taking long time, continue or abort”.

So now question is, How to deal with this situation? And, What kind of ActiveX communication we are dealing with, Which want to take long time to do something? Here are the answers. We are working on ActiveX control which is talking with Microsoft Office applications and process all the tasks or commands given by flash application and return meaningful results. So, If I would like to get a list of all contacts from Microsoft Outlook, it would be enough long task, to produce script is taking too much time, want to abort?

The work around we are currently using is, We had to use JavaScript as a Proxy layer to play a key role in communication between Flash object and the ActiveX control. We are passing or ordering commands to ActiveX control via traditional External Interface way and it just returns that task is accepted by the control or not. Actual result would arrive via Javascript way. So the ActiveX control will call one particular proxy method of Javascript in a same page and which will call a Flash method via External Interface. In Flash, We do receive the unique event name and result that we do expect. Depending on the requirement one can also pass some unique request Ids and expect that back at time of result to make sure, that you are receiving the exact result that you are looking for, not another one with same name!

I am not sure, I will get enough time or not but If I will, Then will post one whitepaper on on FlashBrain site soon.