Posted by Pavel S. in SWF Studio V3 on Feb 11 2011, 05:20 am

I have AS3 northcode application with 2nd Flash player embedded using ActiveX support with AS2 content. Now my applications communicate using LocalConnection, but I want to try to switch it to ExternalInterface. I was able to call AS2 ActiveX from AS3 application, but I'm not sure how to create back call.

I'm using this code to set up communication:

ActionScript3 Code:

ssCore.ActiveX.createObject( { object:"window", progId:"ShockwaveFlash.ShockwaveFlash", left:0, top:0, width:500, height:300, visible:true } );
ssCore.ActiveX.callMethod( { object:"window", method:"CallFunction", request:'<invoke name="onCallback"><arguments><string>test</string></arguments></invoke>' } );

ActionScript2 Code:

ExternalInterface.addCallBack("onCallback", this, onCallback);
function onCallback(value:String):Void{

And this works fine. Now I want to call AS3 method (northcode) from AS2 application (ActiveX). How should I do it?
In previous example I'm using exact ActiveX instance name to access it.
Whic code should i place to in AS2 to access my callback in AS3?

Posted by northcode in SWF Studio V3 on Feb 14 2011, 01:19 pm

When you make an ExternalInterface call from ActionScript it generates an FSCall event on the ActiveX side. When you make an FSCommand call from ActionScript it generates an FSCommand event on the ActiveX side. So you have to listen for those events and parse the data you get back.

Posted by Pavel S. in SWF Studio V3 on Mar 11 2011, 07:38 am

Thanx, that worked for me! Just a small remark - the actual name for this notification turned out to be FlashCall . I suppose this can depend on Flash Player version.

P.S. Discover ActiveX info tool in swf studio - a really nice feature! It helped me a lot.

Posted by northcode in SWF Studio V3 on Mar 11 2011, 10:50 am

My mistake. The event is called "FlashCall" not "FSCall", I must have been thinking ahead to the "FSCommand" part and got ahead of myself. Sorry about that.

For anyone else who hasn't seen the ActiveX Info tool... it can be found on the Help menu in the SWF Studio Toolbar (see item #15) and the ActiveX Oveview in the help describes the output the tool generates and how you can use that with the ActiveX support in SWF Studio. It's been there since we added ActiveX support!