2 Replies Latest reply on Dec 22, 2006 2:28 PM by Targo_06

    Communication with Flash


      I'm developing an aplication in Flex which mainly contains a user interface.I have already a Flash swf file which was embedded in a html page where there was the same user interface, and the user could communicate with the swf using javascript and external interface in ActionScript.Now, I want to embed the swf developed in Flash in the aplication in Flex, and I want to send commands (using the functions in the swf embedded like I did with JavaScript) from Flex to the swf embedded.

      I have read in the documentation, that there is a class called Local Connection to communicate two SWFs but I think that this is in the case when the two SWFs are running in different applications, for example one in a html page and the other in a standalone player.

      I would appreciate any kind of help.

      Thanks a lot in advance.
        • 1. Re: Communication with Flash
          ntsiii Level 3
          No, Local Connection is almost certainly the best solution. It is fine for swf's in the same browser. It is even fine for swfs in the same application, and is in fact the only way to control a Flash 8(AS2) swf from a Flex 2(AS3) app.

          However, if the Flash swf is already set up to be scriptable, then perhaps ExternalInterface would be the best. It lets you invoke javascript in the host wrapper from within the Flex app.

          • 2. Re: Communication with Flash
            Targo_06 Level 1
            Thanks for your advice ntsiii,

            Do you mean that I can use ExternalInterface in the communication with flex?The Flash swf is prepared to communicate with JavaScript through ExternalInterface. Could I call the functions in the flash swf (AS2) in the same way as I call them with JavaScript using ExternalInterface?