简体   繁体   English

如何在Javascript中调用embeded swfs函数?

[英]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.

相关问题 如何在JavaScript中的for循环中调用函数? - How can i call a function from within a for loop in javascript? 如何在iframe中调用javascript函数? - How can I call a javascript function from within iframe? 我如何在 updatepanel 中从后端调用 javascript 函数 - How can i call javascript function from backend within updatepanel 我无法从PHP代码中调用javascript函数 - I can't call a javascript function from within PHP code 如何在 JavaScript 中调用 Less.js 函数? - How can I call a Less.js Function within JavaScript? 如何在javascript中同步调用函数中的一组语句? - How can I call a group of statements within a function synchronously in javascript? 如何从其他JavaScript函数调用Jquery函数 - How can I Call Jquery Function From Other JavaScript function JavaScript和Jquery:如何从JavaScript函数中调用jquery函数 - JavaScript and Jquery: How can you call a jquery function from within a javascript function 如何在Selenium中调用JavaScript函数? - How to call a JavaScript function from within Selenium? 我可以通过编程方式从Javascript / Typescript中的一个函数中以相同的名称调用另一个函数吗? - Can I programmatically call another function with the same name from within a function in Javascript/Typescript?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM