O'Reilly logo

Essential ActionScript 3.0 by Colin Moock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Security-Sandbox-Types

ActionScript assigns a security status known as a security-sandbox-type to every .swf file opened by or loaded into Flash Player. There are four possible security-sandbox-types: remote, local-with-filesystem, local-with-networking, and local-trusted. Each security-sandbox-type defines a distinct set of rules that governs a .swf file's ability to perform external operations. Specifically, the types of external operations a security-sandbox-type can potentially prohibit include:

  • Loading content

  • Accessing content as data

  • Cross-scripting

  • Loading data

  • Connecting to a socket

  • Sending data to an external URL

  • Accessing the user's camera and microphone

  • Accessing local shared objects

  • Uploading or downloading files selected by the user

  • Scripting an HTML page from a .swf file and vice versa

  • Connecting to a LocalConnection channel

In this chapter, we'll see how each security-sandbox-type governs the first five of the preceding types of external operations. To learn how security-sandbox-types govern the remaining types of external operations, see Adobe's documentation, under Programming ActionScript 3.0 → Flash Player APIs → Flash Player Security. Note that when an operation fails due to Flash Player security restrictions, ActionScript either generates a SecurityError or dispatches a SecurityErrorEvent.SECURITY_ERROR event. For details on handling security error conditions, see the section "Handling Security Violations," near the end of this chapter.

How Security-Sandbox-Types Are Assigned ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required