Learn how to make a button which close and open animations, in the same fla file. The animation will be carried out in the scene
1. - First you will need to import (ctrl. + R or File >> Import >>Import to Scene) an image to the Scene, of a document (flash) of dimensions 311 * 311 pixels.
a). The dimensions of the image are 271.5 * 271.5 pixels.
2-. Write in the first Frame a label with the name of (image_1) (Label type Name).
a). Open the panel of (Action – Frame) and to insert a (stop();).
3-. Create a new symbol (Ctrl. + F8).
a)-. Name it open_window and select the option TypeButton.
4-. Locate the symbol to make a button of two states (Up and Over).
a-. Write the word (open) on the button
5-. Return to the scene and introduce a new layer (Layer 2).
a)-. Click on the symbol (open_window) in the Library window, and drag it to Layer 2 place the button in coordinates X = 159.0 y Y = 293.5.
b)-. Select the Frame of the Layer 2 and write a label with the name (image_2) (Label type Name).
c)-. Open the Actions panel (Action – Frame) and insert a (stop();).
d)-. You will have to advance the Frame of the Layer 1 to the Second Frame.
6-. The next step is select the symbol of the Layer 2.
a)-. Open the Actions panel (Action – Button) and insert.
on (release) {
gotoAndPlay("image_01");
}
7. Create a new symbol (Ctrl. + F8).
a)-. Name it close_window and select the option TypeButton.
8-. Insert a Static Text in the close_window symbol and write the letter X.
a)-. Insert a keyframe (F6 in Over) and change the color of the letter of this state.
b)-. Later insert a keyframe (F5 in Down)
9-. Insert a keyframe (F7 in Hit).
a)-. In this frame draw a rectangle of same dimensions that the setter.
10-. Now click on the symbol (close_window) in the Library window, and drag it to scene in the frame 2 of the Layer 1.
a)-. Place the button in the superior part of the scene.
b)-. Select the symbol close_window of the Layer 2. Open the Actions panel (Action – Button) and insert.
on (release) {
gotoAndPlay("image_02");
}
I hope this tutorial helps you. The End.
P.D. Press Ctrl. + Enter and see the final result, make click on the buttons and surprise.
:)See you very soon:)