|
81. Choose Insert > New Symbol.
82.
Create a movie clip and name it as 'reverse'.
83.
Rename the layer as 'actions'.
84.
Select frame 1 on the layer named as actions.
85.
Choose Window > Actions.
86.
In the Frame Actions panel type the following action.
stop
();
87.
Now select next frame i.e frame 2.
88.
Choose Insert > Blank Keyframe.
89.
Choose Window > Actions.
90.
In the Frame Actions panel type the following action.
| tellTarget
("_root.menu1") { |
|
if
(_currentframe
<= 1) {
|
|
|
tellTarget
("_root.reverse")
{
|
|
|
|
gotoAndStop
(1);
|
|
|
}
|
|
|
}
|
else
|
{ |
|
|
|
gotoAndStop
(_currentframe-1);
|
|
}
|
|
|
|
|
}
|
|
|
|
|
In
reverse movie clip At frame 2 this action checks
the condition whether the drop down movie clip (instance
name=menu1) is currently at frame 1 or not.If
it is then reverse movie clip stops at frame
1 and if drop down movie clip is not at frame 1
then it will start playing in reverse direction.(It
will start moving reverse from its current position, frame
by frame.)
i.e.
_currentframe-1
91.
Insert a new layer (Choose Insert
> Layer) above the actions layer and
name is as 'labels'.
92.
Select frame 2.
93.
Choose Insert > Blank Keyframe.
94.
Choose Window > Panels > Frame.
95.
In the Frame panel type the label name as subbuttons1.
96.
Select frame 3 on the layer names as actions.
97.
Choose Insert > Blank Keyframe.
98.
Choose Window > Actions.
99.
In the Frame Actions panel type the following action.
gotoAndPlay
("subbuttons1");
//
At frame 3
ActionScript goes back to subbuttons1 label i.e.frame
2 and starts playing from frame 2.
100.
Now come back into the main scene i.e. Scene 1.
101.
Insert a new layer (Choose Insert
> Layer) above the button1 layer and
rename it as 'reverse'.
102.
Select Window > Library > reverse
movie clip.
103.
Drag the reverse movie clip from the library at layer
named as reverse.
104.
The reverse movie clip will look like a small dot
in the scene.
105.
Select the reverse movie clip.
106.
Choose Window > Panels > Instance.
107.
In the Instance panel type the Instance name as reverse.
Now
we have created a movie clip which can animate the drop down
movie clip in reverse direction.But to interact with this
reverse movie clip we have to create a dummy button.
108.
Choose Insert > New Symbol
109.
Create a button and name it as 'dummy button'.
110.
Draw a small rectangle at frame 1 in the dummy button.
111.
Select Window > Library > drop
down movie clip.
112.
Double click the drop down movie clip to go inside
it.
113.
Insert a new layer (Choose Insert
> Layer) above the actions layer and
rename it as dummy button.
114.
Select Window > Library > dummy
button (button)
115.
Drag the dummy button (button) from the library on
the layer named as dummy button.
116.
Choose Window > Panels > Instance.
117.
In the Instance panel change the Behavior of
the dummy button from button to a movie clip.
118.
Choose Window > Actions.
119.
In the Object Actions panel type the following actions.
|
onClipEvent
(mouseUp)
{
|
|
tellTarget
("_root.reverse") {
|
|
|
gotoAndPlay
("subbuttons1");
|
|
}
|
|
|
}
|
|
|
As
soon as the mouse click releases (anywhere on the movie area)the
ActionScript goes into the reverse movie clip and starts
playing from the subbuttons1 label i.e.frame 2
120.
Choose Window > Panels > Effect.
121.
In the Effect panel select Alpha=0%.
122.
Choose Control > Test Movie.
After
clicking the button1 you can see the drop down movie clip
playing and animation of sub buttons forming one by one.Any
click on the scene can make the drop down movie clip to go
reverse.
Such
a way you can create other menu buttons and their sub buttons
also.
Regards,
All
accompanying logos, brands and product names are trademarks
of their respective companies.
|