This seems to be a problem for beginners to Flash, and I thought I'd address it. When building a Flash-navigated site, you need to link one page to another through the flash interface, just like you would a <a href="otherpage.html">my link</a> in HTML/XHTML.
Once you've created your button on the page, you can link the button very simply. Right-click it, and select "Actions" from the menu. This will open the ActionScript editor, in which you can right ActionScript code. Don't worry. It's not detailed to put this link in.
Make sure you are in Expert Mode, by clicking the arrow in the upper-right hand corner and selecting "Expert Mode". Now type the following code into the editor.
on (release) {
getURL("the_linked_page.htm","_self","GET");
}
The button you created will now go to that link when the mouse clicks it. The getURL function has a prototype that is like this:
getURL(url [,window [, method]])
The window and the method are optional parameters. The url define the resource you want to access. This could be an absolute address, such as "http://www.somesite.com/" or relative to the page that contains the flash movie such as "myotherpage.htm". The window parameter defines the window that you want the url to load in. This could be one of the following:
"_self" - Targets the window that the movie is in.
"_new" - Opens url in a new window
"_top" - Only useful in a framset, targets the top frameset
"_parent" - Targets parent window in a framset
"myWindowName" - where "MyWindowName" refers to the name of a frame in a frameset
The last parameter is one in which the method in which the url is requested, and is either "GET" or "POST". For most of your projects, you will normally use "GET". "POST" is for posting form data, but you usually use the loadVariables function to to this.
That wraps up the tutorial on adding a link to a button in a Flash Movie. I hope this helps everyone. If you have any questions or comments, please reply to this post.


