繁体   English   中英

将Flash标语加载到网页后添加Cookie

[英]Add a cookie once flash banner is loaded on a web page

网页上加载Flash横幅广告后,我想添加一个Cookie。 我在html标记中包含了javascript代码,并且我想使用Actionscript3在.fla文件中使用它。 以下是html标记中的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>

基本上,您将无法知道何时从外部加载swf文件,该调用必须使用ExternalInterface从内部完成

ExternalInterface.call("loadCookie()");

在您无法修改SWF的特殊情况下(您没有源),您可以做的是创建具有与该横幅完全相同的尺寸的SWF,并在此新SWF中的代码中,进行监听装载机

_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteContentLoaderInfo);

然后将对Java的ExternalInterface调用触发。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM