[英]How can I call an embeded swfs function from within Javascript?
I have a swf that is a preloader for another swf (a game). 我有一个swf是另一个swf(游戏)的预加载器。 I need to callback to the game swf from Javascript but can't figure out how to do this. 我需要从Javascript回调游戏swf,但无法弄清楚如何做到这一点。 I can call back into the preloader by registering a callback using the ExternalInterface. 我可以通过使用ExternalInterface注册回调来回调预加载器。
I tried document.getElementById("preloader")
which returns an object. 我尝试了document.getElementById("preloader")
,它返回一个对象。 The preloader
has a public property called GameObj
which returns a reference to the game object which has been loaded by the preloader. preloader
有一个名为GameObj
的公共属性,它返回对预加载器加载的游戏对象的引用。
The issue is, document.getElementById("preloader").GameObj
is always null
. 问题是, document.getElementById("preloader").GameObj
始终为null
。
Is it possible to do this or do I need a wrapper call within the preloader? 是否可以这样做或者我是否需要在预加载器中进行包装调用?
好吧,你可以使用ExternalInterface ,但是有一些原因你不能把你的预加载器放在同一个swf中吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.