How do you detect that a Flash plugin has been temporarily disabled, or, conversely, detect that it has been enabled
To circumvent the Chrome click-to-play throttling, load your SWF from the same domain and protocol as your site.
You can use the AS3 ThrottleEvent
to detect when the SWF has been throttled.
// AS3 code
import flash.events.ThrottleEvent;
import flash.external.ExternalInterface;
stage.addEventListener(ThrottleEvent.THROTTLE, onThrottleEvent);
private function onThrottleEvent(e:ThrottleEvent) {
ExternalInterface.call("onThrottleEvent", e.state); // call javascript function
}
You can setup an ExternalInterface
call to keep track of this state in JavaScript, in JavaScript manage z-index
of your SWF based on if it's throttled or not.
// JS Code
var IS_THROTTLED = false;
window.onThrottleEvent = function (throttleState) {
IS_THROTTLED = (throttleState === "throttle");
}