Posted By

weavermedia on 06/10/11


Tagged

as3


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

weavermedia


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


 / Published in: ActionScript 3
 

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

  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  

You need to login to post a comment.