Tim,
 
Did Rost's suggestion help your situation?  I have a similar issue.  This works:
 
ExternalInterface.call("alert","Hey this is an external interface call.");
 
But when I try to call one of our own _javascript_ functions, it just doesn't seem to find the function and does absolutely nothing.  I even tried getting rid of all the parameters, and just sticking an alert call as the first thing in the _javascript_ function.  It is just not reaching the function.  In my case, neither the

<param name="AllowScriptAccess" value="always"> nor the cross-domain-policy made any difference.

 

I am super-new to Flex.  I am trying to migrate a 1.5 application to 2.0 and am going through major teething pains.  So it is very possible I have some "dumb" problem that more experienced Flexers would not have.

 
--Lisa

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Rostislav Siryk
Sent: Monday, May 22, 2006 7:17
To: [email protected]
Subject: RE: [flexcoders] F2B3: _javascript_ security

Maybe crossdomain Policy File will help?

 

<?xml version="1.0"?>

<!-- http://domainwhereaccesedmovieis/ crossdomain.xml -->

<cross-domain-policy>

  <allow-access-from domain=" domainfromtryingtogetaccessfrom " />

  <!-- following will allow access from all domains -->

  <allow-access-from domain="* " />

</cross-domain-policy>

 

 

Rost

 

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of FineLine
Sent: Monday, May 22, 2006 11:56 AM
To: [email protected]
Subject: [flexcoders] F2B3: _javascript_ security

 

I’m trying to develop a Flex app that calls a _javascript_ function in the container page. I did a simple test app using the call() method of the ExternalInterface API, and it worked fine with the HTML page and the SWF file in the original compile folder. But when I moved both files, the attempt to run the _javascript_ produces the following ActionScript error box:

 

SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller file://C:\ExternalTest.swf may not access file://C:\Container.htm.

            at flash.external::ExternalInterface$/call()

            at SimpleNETComp/::btn1_click()

            at SimpleNETComp/__btn1_click()

 

So, I tried switching it to call the _javascript_ using the navigateToUrl() method of ActionScript. Again, it worked when the files were in the original compile folder, but when I move them to another folder, I get the error:

 

SecurityError: Error #2051: Security sandbox violation: file://C:\ExternalTest.swf may not evaluate scripting URLs within file://C:\Container.htm (allowScriptAccess is 'always'). Attempted URL was _javascript_:test('called with navigateToUrl')

            at ExternalTest/::btn1_click()

            at ExternalTest/__btn1_click()

 

By the way, the HTML file contains only the basic object wrapper, none of the history or version checking stuff, and I changed the SWF parameter to try and open the security up, as follows:

 

<param name="AllowScriptAccess" value="always">

 

Any ideas how to get the calls to work? How does the compile location get stored into the SWF (if that’s what’s happening)?

 

Cheers, Tim




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to