是否有我可以收听的事件会告诉Flash对象何时暂停?

时间:2015-06-24 23:16:06

标签: actionscript-3

如果我暂停整个Flash对象(EG,swfobject.getObjectById(' Object')。StopPlay();)是否有一个我可以在Flash中捕获的事件告诉我这是什么时候发生的?

1 个答案:

答案 0 :(得分:0)

AFAIK there is no special Event to listen for that. But you could use ExternalInterface to do that. Just register a javascriptToActionscriptCall and call it from JS:

AS // swf

import flash.external.ExternalInterface;

ExternalInterface.addCallback("sendStopStatusToAS", callStopFromJavaScript);         

function callStopFromJavaScript():void {
    trace("SWF stopped by JS");
}

JS

swfobject.getObjectById('Object').StopPlay();
swfobject.getObjectById('Object').sendStopStatusToAS();

Greetings