Preparation of Hyperlink buttons for as2.0 and as3.0 and common languages
=====As2======================================
1. Create a new layer in the Flash layer. Here we name it "transparent button ". Use a rectangle tool to draw a rectangle of the same size as the flash image.
2. Select the drawn rectangle and press F8 to convert it into a key component. Here we will give a name.
3. Set the transparency of the button component to 0%.
4. Select the transparent button and right-click the action (or press F9) to enter the action panel:
Write the following code into the panel:
On (release ){
Geturl ("http://www.2lengzi.com", "_ blank ")
}
The test is complete.
=====As3======================================
1. Create a new layer in the Flash layer. Here we name it "transparent button ". Use a rectangle tool to draw a rectangle of the same size as the flash image. And convert it to button components.
2. Select the named button and give it an Instance name. For example, we name it star_btn"
3. Create a new layer, name it as, and press F9 to open the action panel. Write the following code in the Action panel:
Star_btn.addeventlistener (mouseevent. Click, starurl );
Function starurl (E: mouseevent): void
{
VaR request: URLRequest = new URLRequest ("http://www.2lengzi.com /");
NavigatetoURL (request );
}
The test is complete.
Common statements:
Transfer to next frame
First, you name the button instance on the stage, such as BT, and then write the code on the timeline: Stop (); BT. addeventlistener (mouseevent. click, bthd); function bthd (E: mouseevent) {This. nextframe ();}
Flash CS6 transparent button link Creation