Each action must be in a keyframe.
It's a good design strategy to keep all your actions on a separate layer named "Actions" or something similar.
To make a button that, when clicked, loads a URI, right-click the button's instance, and select "Actions" from the menu. Then, enter this code:
on( release )
getURL( "", [""], [""] )
where "target" refers to a window type (e.g. "_blank" for a new window).
One commonly used ActionScript function is gotoAndPlay. It takes the form gotoAndPlay( ). When run, it will move the player to that frame and resume play. For example, gotoAndPlay( 5 ) will move to frame 5 and resume playing, and gotoAndPlay( "menu" ) will go to the frame named "menu" and resume playing.
A similar function is gotoAndStop( ), which goes to the frame referenced but does not resume playing.