Why does the SWF compiled by flash builder run normally in Bin-Debug and cannot be copied to other folders?

Source: Internet
Author: User
Document directory
  • 1. Use a local trusted File
  • 2. Specify local playback security during compilation

I believe most developers who use flash Builder/flex builder for development have encountered this problem. The compiled SWF is opened in Bin-Debug (not debugging in IDE environment, you can directly double-click to open it with Flash Player). If you copy it to another folder, a security error will pop up. This is because Flash Player imposes restrictions on the security of local playback. For details, see the "permission control" section in the official documentation. If you do not want to read the official documentation, continue.

There are two ways to solve this problem:

1. Use a local trusted File

In Windows XP, the path to the local trusted file of the current user is:
C: \ Documents and Settings \ [your username] \ Application Data \ Macromedia \ Flash Player \ # security \ flashplayertrust

The path to the global trusted file is:
C: \ windows \ system32 \ macromed \ Flash \ flashplayertrust

Create a new plain text file in this folder. The file name is in English and the extension is cfg. The content of the file is the local path of the SWF file you want to trust. You can create one path per line.

For example, in my trusted path, flashbuilder automatically creates a list of local trust files named flashbuilder_plugin.cfg, and automatically adds the bin-DEBUG directory of all current projects, part of the content is:

C: \ Documents and Settings \ Administrator \ Adobe Flash Builder 4 plug-in
E: \ works \ kaitian \ demo \ testnullfun \ bin-Debug
E: \ works \ kaitian \ demo \ testpost \ bin-Debug
E: \ works \ kaitian \ demo \ vector \ bin-Debug
E: \ works \ zrong.googlecode.com \ bin

By default, these directories already exist in trusted files, so they are trusted. In this way, you can directly open the SWF file in Bin-Debug without permission restrictions. If the folder is copied to another folder, which is not in the trusted directory, the permission is restricted and a security error occurs.

You can also use the Configuration Manager to do this: http://www.adobe.com/go/settingsmanager_cn.

There is also an old article about it in detail.

2. Specify local playback security during compilation

If the SWF file is loaded in the running state, if the SWF file is not in the trusted directory when it is run separately, A security error is displayed (provided that the debug Flash Player is used) and external files cannot be loaded.

Sometimes we download some SWF games on the Internet and download the resources required by these games together and put them in the correct folder, but the security error still occurs, which is the reason. In this case, you only need to build a web server locally and put the SWF to be run in the Web environment.

If the created SWF runs only locally, you can set its playback security to "only access local files" so that whether or not it is in the trusted directory, you can load local external files. In flash, you can set the publishing settings:

In flash Builder/flex builder, you can use the compilation parameter-use-network = false, for example:

 

Reprinted: http://zengrong.net/post/1206.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.