Ensure that throttling is supported in browser AS3

主宰稳场 提交于 2019-12-13 03:16:39

问题


How can I ensure that the ThrottleEvent is supported by the current used browser?

I can see that they mention some browsers which support it:

The platforms that support throttling and pausing are currently the following: Flash Player Desktop Mac and Windows, AIR Mobile, and Flash Player Android. The following platforms do not dispatch the ThrottleEvent automatically because they do not yet support pausing or throttling: AIR for TV devices, AIR for desktop, and Flash Player Linux Desktop.

But I don't think that I can check specifically for each one of them (I guess there are edge cases too).

I'd like to do something like this:

package
{
    import flash.display.MovieClip;
    import flash.external.ExternalInterface;
    import flash.events.ThrottleEvent;
    import flash.events.ThrottleType;

    public class TestThrottle extends MovieClip
    {
        public function TestThrottle()
        {
            var throttlingIsEnabled = ???
            ExternalInterface.call('throttlingSupported', throttlingIsEnabled);
        }
    }
}

Do you know a way how I could achieve this?


回答1:


As you mentioned in your question :

The platforms that support throttling and pausing are currently the following: Flash Player Desktop Mac and Windows, AIR Mobile, and Flash Player Android. ...

And as you are writing for Flash Player, so you have just to verify if it's Flash Player Desktop Mac or Windows to know if throttling and pausing are supported, and you can verify that using flash.system.Capabilities especially Capabilities.version, Capabilities.os and Capabilities.playerType.

Hope that can help.



来源:https://stackoverflow.com/questions/28989153/ensure-that-throttling-is-supported-in-browser-as3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!