Problem accessing ExternalInterface exposed method in Google Chrome

后端 未结 5 1094
深忆病人
深忆病人 2020-12-13 11:54

My simple ActionScript I am trying to use Flash\'s ExternalInterface to setup a callback so that JavaScript can call a method on my Flash object. Everything works fine in

5条回答
  •  庸人自扰
    2020-12-13 12:25

    I was having problems with ExternalInterface and Firefox and Chrome and discovered that the Adobe Script was not writing the Flash tag quickly enough, so when the browser tried to find the addCallback() function it was not there at the time.

    Simply putting my Javascript function that calls the Flash created addCallback() in a window.setTimeout() calling solves the problem. Delays less than 200 ms still make the problem to occur.

    I didn’t have to use the solution of trying to find if the “length” attribute exists in the document[FlashId] object. Just calling “FlashEmbed = document[FlashId]” worked just fine.

提交回复
热议问题