1 Reply Latest reply on Mar 17, 2010 9:22 PM by jxpeck

    ExternalInterface with Player 10 globalplayer.swc

    jxpeck

      Not directly related to Stratus, but this forum is so helpful, I thought I would ask:

       

      My app works fine with exteranl Interface using 9.0.124,

      but of course it cannot resolve NetStream.nearID...

       

      But when compiled/linked with Player 10 (-target-player 10.0.0)

      The callbacks from javascript into flex fail.

      [my app does a series of addCallback; 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;

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

        work just fine. 

      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?