单击按钮时,我试图从我的 Flash 文件中调用 jQuery 函数。我试图在 stackoverflow 和 google 上搜索类似的问题,但我无法解决这个问题。
仅供参考,我在本地和在线都对此进行了测试,但没有结果。
Actionscript 3.0 调用:
导入 flash.external.ExternalInterface;
open_mc.buttonMode = true;
open_mc.useHandCursor = true;
open_mc.addEventListener(MouseEvent.CLICK, ClickFunc);
函数 ClickFunc(evt:MouseEvent):void
{
ExternalInterface.call("openContainer", "open_god_dammit");
}
jQuery:
$(文档).ready(函数() {
$("#eas_sidekick_container").hide();
$("#eas_sidekick_container").css('width', '0px');
函数 openContainer(open_god_dammit)
{
$("#eas_sidekick_container").show();
$("#eas_sidekick_container").animate({
宽度:'850px'
});
$('html, body').animate({
向左滚动:'850'
});
}
});