1. Go ahead and rename the default layer in your flash document to button. Create a new layer and rename it code.
2. Go to Insert >> New Symbol and create a new button and name it My_Button.
3. Rename the default layer to bg and create a new rectangle 120 wide and 40 high. Give it a color of #0053A4. Insert a new layer and rename it text. Create a static text field and align it properly.
4. Drag the button from the library into the button layer. Give it an instance name of my_button.
5. Go to the code layer and add the following code:
my_button.addEventListener(MouseEvent.CLICK, gotoURL);
function gotoURL(e:MouseEvent):void {
navigateToURL( new URLRequest( "http://www.flashsource.blogspot.com" ), "_blank" );
}
6. Save your work and test the movie.
Download Source
0 comments:
Post a Comment