Solve the securityerror: Error #2060: Security Sandbox violation: externalinterface caller exception.

Source: Internet
Author: User

Previously, the Flash file of flex application was built with ant, but it is directly embedded in HTML. If it is locally accessed, an error window is displayed, and the report is as follows:

 

Securityerror: Error #2060: Security Sandbox violation: externalinterface caller file: // D: /workdir/EOS projects/bps/v6.1/doc/bps61/doc/04_requirement/Draft/bps_ui/build/flowdesigner3.swf cannot access file: // D: /workdir/EOS projects/bps/v6.1/doc/bps61/doc/04_requirement/Draft/bps_ui/build/flowdesigner3.html. <br/> at flash. external: externalinterface $/_ initjs () <br/> at flash. external: externalinterface $/addcallback () <br/> at flowdesigner3/appcomplete () <br/> at flowdesigner3/___ flowdesigner3_application1_1_applicationcomplete ()

 

This exception occurs because the local file does not have the permission to access Js. You can set the file to access the script when introducing the SWF file in HTML. The following code sets the "allowScriptAccess" parameter to "always": (the following code uses the swfobject component)

 

<MCE: Script Type = "text/JavaScript" src = "swfobject. JS "mce_src =" swfobject. JS "> </MCE: SCRIPT> </P> <p> <MCE: Script Type =" text/JavaScript "> <! -- <Br/> var flashvars ={}; <br/> var Params ={< br/> allowScriptAccess: "always" <br/> }; <br/> var attributes = {<br/> ID: "flowdesigner" <br/>}; <br/> swfobject. embedswf ("flowdesigner3.swf", "mycontent", "100%", "100%", "9.0.0", "expressinstall.swf", flashvars, Params, attributes ); <br/> // --> </MCE: SCRIPT>

 

For example, if the object tag is used, it is as follows:

<Param name = "allowScriptAccess" value = "always"/>

 

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.