6 Replies Latest reply on Mar 17, 2010 10:04 PM by jxpeck

    ExternalInterface with Player 10 globalplayer.swc

    jxpeck

      My app works fine with exteranl Interface using 9.0.124,

      but as I'm moving to Stratus/RTMFP for P2P it cannot resolve NetStream.nearID...

       

      When the app is compiled/linked with Player 10 (-target-player 10.0.0)

      the callbacks from javascript into flex fail.

      [my app does a series of addCallback(name, closure); on applicationComplete,

      it passes the list of method names to js; like a simplified version of FABridge]

       

      Many of the closures are of the form:

           function(x:Boolean):void { localMethod(x); }

      or  function(x:Boolean):void { localObject.someMethod(x); }

      where the localMethod is defined in the mxml/as3 object.

      and localObject is likewise defined as a public var of the mxml object.

       

      But when invoked in player 10; it fails saying:

       

      TypeError: Error #1006: localMethod is not a function. 

         at MethodInfo-1614()

         at Function/http://adobe.com/AS3/2006/builtin::apply()

         at flash.external::ExternalInterface$/_callIn()

          ...

       

      or (trying to evaluate "localObject")

       

      TypeError: Error #1010: A term is undefined and has no properties.

        at MethodInfo-1622()

        at Function/http://adobe.com/AS3/2006/builtin::apply()

        at flash.external::ExternalInterface$/_callIn()

        at <anonymous>()

       

       

       

      Note: this works with Player 9's globalplayer.swc

      Note: closures of the form: function(x:Boolean):void { Pkg.staticMethod(x); }

        work just fine (as it can dispatch without reference to local bindings...) 

      It appears the binding-stack of the closure is not being correctly evaluated inside the ExternalInterface.

      Is this a known problem?

      What needs to be done to make this work with the 10.0.0 swc?