ActionScript3:Using URLRequest and navigateToURL
|Flash11 (CS5) | Flash10 (CS4) <|
|Table of contents|
By the end of this page you will be able to:
Using a combination of the ActionScript3
URLRequest class and
navigateToURL allows new content to be opened within a browser window. Content needs to be contained within the same domain to work, unless permission is granted via policy files. This is a security measure to prevent cross site scripting attacks, but for general purposes within a single domain, policy files and permissions will not be needed and
navigateToURL work well to navigate between individual swf files that make up a flash based website.
Creating the Connections
This small tutorial assumes you have a series of swf files that you need to load via button clicks, into a web browser window. On each FLA file, that has the button that will be responsible for the navigation, you need to add a small piece of ActionScript3, on frame one of the Actions Layer.
Easy! This will replace the current browser window content with that of the swfOne.swf. Add as many
eventListeners to as many buttons your need to complete your navigation.
For other ways to link up your AS3 swf's, check out these:
- ActionScript3:Using the Loader Class to load an external swf
- ActionScript3:Using addChild and removeChild