2 Replies Latest reply on Jun 16, 2006 4:20 AM by prdv

    ExternalInterface | How to get called from flash in"xml flavor"?

    prdv Level 1
      Hi guys,
      I have seen that ActiveX version of Flash Player issues an event (FlashCall) that describes using xml the function call that the programmer has called with ExternalInterface.call method.
      That xml has the form : <invoke name="thenameofthefunction"><arguments>...</arguments></invoke>
      However, regarding the NPPlugin version, when you make a "ExternalInterface.call" flash always ask to its container to "evaluate" a chunk of javascript code.
      Also, both flash player versions (ActiveX and NPPlugin) provide the "CallFunction" method that allows you to pass, in a single parameter, an xml (in the same form as the one from "FlashCall" event) describing the actionscript function (and its arguments) to be called.

      I would need to use the "xml flavor" in both directions (flash to container and container to flash) independently of the version of Plash Player being used (ActiveX or NPPlugin). The reason: I do not have any problem parsing and consuming xml and, however, I do not want to write a javascript interpreter at all.

      Does anyone know if there is any possibility to instruct flash npplugin, in any way, to describe the function calls using xml instead of javascript?

      Any suggestion will be welcome.

      Best regards.
        • 1. Re: ExternalInterface | How to get called from flash in&quot;xml flavor&quot;?
          prdv Level 1
          Come on guys!... Sure that any of you can not say anything about this?... even a "hey fool, the thing you are trying is not possible at all" or "this is not the right place for your post, avoid bothering us".
          Anything will be appreciated (I'm reaching desperation already)
          • 2. Re: ExternalInterface | How to get called from flash in&quot;xml flavor&quot;?
            prdv Level 1
            Hi people,

            Finally I've got the answer to my question:
            It seems that there is not a feasible way to achieve that Flash Player (Netscape Plug-in) calls into its wrapper using the XML pattern that uses its "brother" (ActiveX Flash Player). Thus, the solution is to interpret the chunk of javascript code in the best way that is suitable for your (my) needs.

            Bellow, for your convenience, is the answer I got from one of the player architecs.

            Thanks a lot to Matt, Gary and all the people that replied to this topic.

            For the Netscape plug-in, I think the easiest thing for him to do is
            just to parse the JS coming from the Player. You don't need a full
            _JavaScript interpreter to do it. The _JavaScript code generated always
            follows the same basic pattern. A parser to transform it into XML or
            any other data structures would probably only be a few hundred lines.