How to check if SWF works as an AIR application?

I am wondering if there is a way for SWF to check at runtime whether it works as an online SWF or an AIR application? I need to use the same SWF to run both online and locally, however when launched as an AIR application, external resources are in a different directory. I would like to check if the SWF is local or online, so I can change the source path for external assets accordingly.

Thanks Sandro

Edit: I just realized this might be a dumb question. :) I can just use flashvars to tell SWF that it is running in an AIR application.

+7
flash actionscript-3 air
source share
1 answer

You can use the Capabilities class.

import flash.system.Capabilities; switch (Capabilities.playerType) { case 'Desktop': //air runtime break; case 'PlugIn': case 'ActiveX': //browser break; } 

Additional Information from Adobe Link to ActionScript 3 .

+15
source share

All Articles