Detecting Apollo capabilities in a SWF file
Back to: Apollo Documentation home page
For a file that is bundled with the Apollo application, the Security.sandboxType property is set to the value defined by the Security.APPLICATION constant. So, you can check to see if a SWF file is in the Apollo security sandbox, and load other content (which may or may not contain Apollo-specific APIs) accordingly, as in the following:
ActionScript example:
if (Security.sandboxType == Security.APPLICATION)
{
// Load SWF that contains Apollo APIs
}
else
{
// Load SWF that does not contain Apollo APIs
}
ActionScript example:
if (window.runtime)
{
if (runtime.flash.system.Security.sandboxType == runtime.flash.system.Security.APPLICATION)
{
alert("In Apollo application security sandbox.");
}
else
{
alert("Not in Apollo application security sandbox.")
}
}
else
{
alert("Not in Apollo.")
}
All resources that are not installed with the Apollo application are put in the same security sandboxes as they would be placed in if they were running in Flash Player in a web browser. Remote resources are put in sandboxes according to their source domains, and local resources are put in the local-with-networking, local-with-filesystem, or local-trusted sandbox.
You can check if the Capabilities.playerType static property is set to "Desktop" to see if SWF content is running in the Apollo runtime (and not running in Flash Player running in a browser).
Back to: Apollo Documentation home page