SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller file:///C:.swf cannot access file:///C

Hi,

I just finished developing my Flex Application (using the Trial Adobe Flex Builder 3.0) and after going to Project > Export Release Build, I can see that when I view my project inside the Adobe Flex software, my application works beautifully.

Now if I go to bin-release\BackupOptimizerPartII.html (where BackupOptimizerPartII.html embeds the .swf file), I keep getting the following error in both FireFox and Internet Explorer:

SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller file:///C:/Documents and Settings/paggarwala/Desktop/Flex/bin-release/BackupOptimizerPartII.swf cannot access file:///C:/Documents and Settings/paggarwala/Desktop/Flex/bin-release/Copy of BackupOptimizerPartII.html.
      at flash.external::ExternalInterface$/_initJS()
      at flash.external::ExternalInterface$/addCallback()
      at bridge::FABridge/initializeCallbacks()
      at bridge::FABridge()
      at BackupOptimizerPartII/_BackupOptimizerPartII_FABridge1_i()
      at BackupOptimizerPartII()
      at _BackupOptimizerPartII_mx_managers_SystemManager/create()
      at mx.managers::SystemManager/initializeTopLevelWindow()
      at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()
      at mx.managers::SystemManager/docFrameListener()

--

I did research online and followed exaclty what Curtis Morley said on his website by removing all the 'same domain' and 'never' tags to 'always' as shown on his site:

http://curtismorley.com/2008/11/01/actionscript-security-error-2060-security-sandbox-violation/

...yet nothing follows through. Does anyone have any clue what the heck is going on? Do I need to purchase the original to get this to work? I need to demo this to my boss in less than 24 hours ON my domain (even with the "trial" written on it).

Shown below is my *.html code that embeds the Flex *.swf file. Any help please? Completely appreciated.


<!-- saved from url=(0014)about:internet -->
<html lang="en">
 
<!-- 
Smart developers always View Source. 
 
This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR. 
 
Learn more about Flex at http://flex.org 
// -->
 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
<!--  BEGIN Browser History required section -->
<link rel="stylesheet" type="text/css" href="history/history.css" />
<!--  END Browser History required section -->
 
<title>Step 3</title>
<script src="AC_OETags.js" language="javascript"></script>
 
<!--  BEGIN Browser History required section -->
<script src="history/history.js" language="javascript"></script>
<!--  END Browser History required section -->
 
<style>
body { margin: 0px; overflow:hidden }
</style>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 124;
// -----------------------------------------------------------------------------
// -->
</script>
</head>
 
<body scroll="no">
<script language="JavaScript" type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);
 
// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
 
if ( hasProductInstall && !hasRequestedVersion ) {
	// DO NOT MODIFY THE FOLLOWING FOUR LINES
	// Location visited after installation is complete if installation is required
	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
	var MMredirectURL = window.location;
    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
    var MMdoctitle = document.title;
 
	AC_FL_RunContent(
		"src", "playerProductInstall",
		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
		"width", "100%",
		"height", "100%",
		"align", "middle",
		"id", "BackupOptimizerPartII",
		"quality", "high",
		"bgcolor", "#869ca7",
		"name", "BackupOptimizerPartII",
		"allowScriptAccess","always",
		"type", "application/x-shockwave-flash",
		"pluginspage", "http://www.adobe.com/go/getflashplayer"
	);
} else if (hasRequestedVersion) {
	// if we've detected an acceptable version
	// embed the Flash Content SWF when all tests are passed
	AC_FL_RunContent(
			"src", "BackupOptimizerPartII",
			"width", "100%",
			"height", "100%",
			"align", "middle",
			"id", "BackupOptimizerPartII",
			"quality", "high",
			"bgcolor", "#869ca7",
			"name", "BackupOptimizerPartII",
			"allowScriptAccess","always",
			"type", "application/x-shockwave-flash",
			"pluginspage", "http://www.adobe.com/go/getflashplayer"
	);
  } else {  // flash is too old or we can't detect the plugin
    var alternateContent = 'Alternate HTML content should be placed here. '
  	+ 'This content requires the Adobe Flash Player. '
   	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
    document.write(alternateContent);  // insert non-flash content
  }
// -->
</script>
<noscript>
  	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="BackupOptimizerPartII" width="100%" height="100%"
			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
			<param name="movie" value="BackupOptimizerPartII.swf" />
			<param name="quality" value="high" />
			<param name="bgcolor" value="#869ca7" />
			<param name="allowScriptAccess" value="always" />
			<embed src="BackupOptimizerPartII.swf" quality="high" bgcolor="#869ca7"
				width="100%" height="100%" name="BackupOptimizerPartII" align="middle"
				play="true"
				loop="false"
				quality="high"
				allowScriptAccess="always"
				type="application/x-shockwave-flash"
				pluginspage="http://www.adobe.com/go/getflashplayer">
			</embed>
	</object>
</noscript>
</body>
</html>

Open in new window

piyushdabombAsked:
Who is Participating?
 
Jones911Connect With a Mentor Commented:
In your MXML do you reference a real path ie c:\something
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.