AS3 detect flash player type - broswer plugin, standalone, IDE etc


/ Published in: ActionScript 3
Save to your folder(s)

Useful if you want to control certain debugging or reporting features on the fly.


Copy this code and paste it in your HTML
  1. import flash.system.Capabilities;
  2.  
  3. var pType:String = String(Capabilities.playerType);
  4.  
  5. if (pType == "Plugin" || pType == "ActiveX") {/* swf is running a browser */};
  6. if (pType == "Desktop") {/* swf is running in a desktop AIR application */};
  7. if (pType == "StandAlone") {/* swf is running in a standalone Flash Player */};
  8. if (pType == "External") {/* swf is running in the Flash IDE preview player */};

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.