我想调用我的函数ActionScript closeApp:
public function closeAutorun(event: CairngormEvent): void {
Alert.show(
LMSModel.ERR_MESS_QUESTION,
LMSModel.ERR_MESS_TITLE,
3,
FlexGlobals.topLevelApplication as Sprite,
alertClickHandler);
}
当用户关闭标签或导航器时。
有什么建议吗?
Thx
答案 0 :(得分:0)
在动作脚本中,在程序的开头:
if (ExternalInterface.available) {
ExternalInterface.addCallback("closeAutorun", closeAutorun);
}
在javascript中:
window.onbeforeunload = confirmClose;
function confirmClose() {
document.getElementById('app').closeAutorun();
}
其中“ app”是swf实例的ID。