在JavaScript中嵌入SWF

时间:2013-10-18 19:24:01

标签: javascript actionscript-3 flash

我想将swf嵌入到javascript中,我知道有一种方法可以做到这一点,但我该怎么做?这是我的javascript

<script type="text/javascript">
adroll_adv_id = "JD5ZGBNO4RBYVAMMMPX3J7";
adroll_pix_id = "CEJOJM5N5VAHBKCVMT2DML";
(function () {
var oldonload = window.onload;
window.onload = function(){
__adroll_loaded=true;
var scr = document.createElement("script");
var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com");
scr.setAttribute('async', 'true');
scr.type = "text/javascript";
scr.src = host + "/j/roundtrip.js";
((document.getElementsByTagName('head') || [null])[0] ||
document.getElementsByTagName('script')[0].parentNode).appendChild(scr);
if(oldonload){oldonload()}};
}());
</script>

我实际上有一个flash横幅,我想把这个javascript称为那个横幅

1 个答案:

答案 0 :(得分:0)

如果您想从闪存中调用 javascript 功能,则需要通过Flash代码进行此类调用,

Externalnterface.call(“function_name”,“arg”);

您需要导入库 flash.external.ExternalInterface ;