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