ProblemYou want to know what type of Flash Player the .swf is being run from. SolutionUse the flash.system.Capabilities.playerType property. DiscussionThe different types of Flash Player include:
There are instances when you need to know which player the .swf is currently being run in. For example, if you are doing any type of integration with browser scripts (e.g., JavaScript, VBScript), it may be important to know whether the application is being run in Internet Explorer or some other type of browser, as these browsers can have different behaviors when running scripts. Indeed, it would be vital to know that the .swf was being run in a standalone player, since JavaScript, etc., would not be available at all in such a case. To check the player type, look at the value of flash.system.Capabilities.playerType. Possible values are PlugIn, ActiveX, StandAlone, and External. You could use this in an if statement: if(flash.system.Capabilities.playerType == "Plugin") { // do actions for Mozilla, etc. browsers } else if(flash.system.Capabilities.playerType == "ActiveX") { // do actions for IE } else { // do actions for no browser } |