ExternalInterface.call () implementation as and js communication problems and solutions

2010-12-14  来源:本站原创  分类:Flash  人气:175 

Recently encountered a difficult problem is to design and Js As Flex project compiled communication, the bin-debug directory on the other path, in which the As and Js communications problems may occur. And even the SDK's sdks \ 3.2.0 \ frameworks \ javascript \ fabridge \ samples following example will not run properly.

After the try catch for exception to # 2060 Security sandbox violation issue. But how to solve this problem.

google a bit and found this nice blog, which said very detailed, not to repeat the principle, for example:


Main reason is that Flex security sandbox problem, by the above solution has a blog.

1. To find the local computer to install Flash Player, the path is win7 my path is:

(C: \ Windows \ SysWOW64 \ Macromed \ Flash \ FlashPlayerTrust),

(Note: If the folder in which FlashPlayerTrust not need to create, xp path should be: C: \ Windows \ System32 \ Macromed \ Flash \ FlashPlayerTrust)

2. In FlashPlayerTrust create a folder. Cfg (you can customize the name), the file content

c: \

d: \

e: \

(Note: This plugin can specify the installation path of the future and reduce risk. Each path on a line with # to add comments)

3. Have said above operating on the c / d / e disk can be normal under the flash file and Js As the completion of the communications.

The key is the security mechanism Flex, Flex's security model is built around SWF files, local data and the Internet URL and other resources to design these objects. Design to the above question should be user-controlled computer management.

Manage users and install the application can specify a local swf file for registration as a fiduciary. These swf files will be assigned to a local trusted sandbox. They can swf file with any other interaction, or from any location (remote or local) to load the data.

Need to add the plug-in authorization documents.

Through this setting, communication is normal, and through this issue on security sandbox security mechanism learn a lot about dealing with security issues on the content of organic save the point of experience.