How to tell if Flash AS3 is running in desktop or mobile browser

前提是你 提交于 2019-12-24 15:39:54

问题


I am developing a full-Flash site (Player 10.2).

I need to know at runtime if code is running on a desktop/mouse computer or a mobile/touch device, so that I can differentiate the input mechanism.

Is this by any means possible?


回答1:


How's flash.system.Capabilities.version look?




回答2:


Use flash.system.Capabilities.os to check.




回答3:


For AIR 3.9: Capabilities.manufacturer returns "Adobe iOS" on ipad2, "Android Linux" on Galaxy s4. Capabilities.version returns "IOS 11,9,900,117" on ipad2 and "AND 11,9,900,117" on Galaxy s4.




回答4:


You could check to see if the device has accelerometer support. If so, you know it's a mobile device. I dont know exactly what it is you would like to do so I dont know if this will work well for your project. It will distinguish mobile from desktop, though.

if(Accelerometer.isSupported){
    //mobile device
    //os still unknown
else{
    //desktop or laptop
    //os still unknown
}


来源:https://stackoverflow.com/questions/9811871/how-to-tell-if-flash-as3-is-running-in-desktop-or-mobile-browser

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