Learning ActionScript 2.0 in Adobe Flash |
|
|
|
| What's New in Flash ActionScript > Changes to security model for locally installed SWF files | |||
Flash Player 9.x introduces support for a new HTML tag, allowNetworking. For more information, see the Security chapter in Programming ActionScript 3.0.
Flash Player 8 introduced a new, improved security model in which Flash applications and SWF files on a local computer can communicate with the Internet and the local file system, rather than run from a remote web server. When you develop a Flash application, you must indicate whether a SWF file is allowed to communicate with a network or with a local file system.
|
NOTE |
In this description, a local SWF file is a SWF file that is locally installed on a user's computer, not served from a website, and does not include projector (EXE) files. |
In previous versions of Flash Player, local SWF files could interact with other SWF files and load data from any remote or local computer without configuring security settings. In Flash Player 8 and later, a SWF file cannot make connections to the local file system and the network (such as the Internet) in the same application without making a security setting. This is for your safety, so a SWF file cannot read files on your hard disk and then send the contents of those files across the Internet.
This security restriction affects all locally deployed content, whether it's legacy content (a FLA file created in an earlier version of Flash) or created in Flash 8 and later. Using the Flash MX 2004 or earlier authoring tool, you could test a Flash application that runs locally and also accesses the Internet. In Flash Player 8 and later, this application now prompts the user for permission to communicate with the Internet.
When you test a file on your hard disk, there are several steps to determine whether the file is a local trusted (safe) document or a potentially untrusted (unsafe) document. If you create the file in the Flash authoring environment (for example, when you select Control > Test Movie), your file is trusted because it is in the test environment.
In Flash Player 7 and earlier, local SWF files had permissions to access both the local file system and the network. In Flash Player 8 and later, local SWF files can have three levels of permission:
For more details about each level of permission, see About local file security and Flash Player.
There are also minor changes to System.security.allowDomain and improvements to System.security.allowInsecureDomain. For more information on local file security, see Understanding Security.
|
|
|
|