| Flex 2 Developer's Guide > Flex Programming Topics > Communicating with the Wrapper > Accessing JavaScript functions from Flex > Using the navigateToURL() method in Flex | |||
The navigateToURL() method loads a document from a specific URL into a window or passes variables to another application at a defined URL. You can use this method to call JavaScript functions in the HTML page that encloses a Flex application.
You should not confuse the functionality of the navigateToURL() method with the load() method of the URLLoader class. The URLLoader class loads a specified URL into an object for manipulation with ActionScript. The navigateToURL() method navigates to the specified URL with a browser.
In most cases, you should use the ExternalInterface API to perform Flex-to-wrapper communication. However, the navigateToURL() method is not part of the ExternalInterface API and, therefore, does not have as stringent a set of requirements for which browsers support it. These requirements are described in About the ExternalInterface API.
The navigateToURL() method is restricted by the security sandbox in which the SWF file is running. Its use relies on the domain-based security restrictions that the allowScriptAccess and allowNetworking parameters define. You set the values of the allowScriptAccess and allowNetworking parameters in the SWF file's wrapper.
For more information on these parameters, see Creating a Wrapper in Building and Deploying Flex 2 Applications. For more information on security restrictions, see Applying Flex Security in Building and Deploying Flex 2 Applications.
Flex 2.01
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flex/201/html/passingarguments_086_10.html