|
6. Once again choose Insert >
Convert to Symbol to convert the Button into a
Movie Clip and name it as 'on-off clip'
7. Choose Window > Properties
8. In the Properties panel type the Instance name
as 'onoff'
9.
Choose Edit > Edit in Place
to go inside the on-off clip movie clip.
10. Rename the existing layer as 'On-Off Button'
11. Select the on-off button on the stage and choose
Window > Actions
12. In the Actions panel type the following actions
| on
(release) { |
| |
stopAllSounds(); |
| |
gotoAndStop(2); |
| } |
// stopAllSounds();
This
action stops all playing sounds in the Flash movie.
// gotoAndStop(2);
After performing stopAllSounds actions,
actionscript will go to frame 2 and will stop there.
13.
Insert a new layer above On-Off Button layer
and name it as 'Actions'.
14.
Select frame 1 on Actions layer and choose Window
> Actions
15. In the Actions panel type the following action
stop();
16.
Select frame 2 on the same layer and choose Insert
> Keyframe
17. In the Actions panel type the following action
stop();
18.
Select frame 2 of On-Off Button layer and choose
Insert > Keyframe
19. Select on-off button at frame 2
20. Choose Window > Actions
21. In the Actions panel, delete the existing
actions and type the following actions
| on
(release) { |
| |
if
(_root.soundno1 == "yes")
{ |
| |
|
_root.snd1.start(0,
999999); |
| |
}
else if (_root.soundno2
== "yes") { |
| |
|
_root.snd2.start(0,
999999); |
| |
}
else if (_root.soundno0
== "yes") { |
| |
|
_root.snd1.start(0,
999999); |
This
actionscript will check if the value of soundno1 or soundno0
is 'yes' then sound1 will start playing and if the value
of soundno2 is 'yes' then sound2 will start playing. After
performing this action the actionscript will stop at frame
1.
22.
Go back into Scene 1 and select track1 button
on the stage.
23. Choose Window > Actions
and add the following action to the existing
actions at the place as shown in the image.
_root.onoff.gotoAndStop(1);
// _root.onoff.gotoAndStop(1);
With this action, the actionscript will
enter into on-off clip movie clip and will stop at frame 1.
24.
Similarly, select track2 button and add the
same action to its existing actions below _root.soundno1
= "no";
25. Choose Control > Test Movie
and check how both the sound tracks' functionality works.
When
any of the sound track is playing, we do not come to know
which sound track is 'ON'. To identify which sound track is
playing you need to create 2 small animations Movie Clips
for each sound track, name the Movie Clips as sound animation
1 and sound animation 2
Here
we have created small animations of musical symbols i.e. sound
animation 1 Movie Clip and sound animation 2 Movie
Clip.
1.
Insert a new layer above Track 2 Button and
rename it as 'Sound Animation 1'
2. Choose Window > Library >
sound animation 1 movie clip
3. Drag the sound animation 1 movie clip on Sound
Animation 1 layer.
4. Choose Window > Properties
5.
In the Properties panel type the Instance name
as 'soundani1'
6.
Similarly, place the sound animation 2 movie clip on
a new layer named as 'Sound Animation 2'
7. In the Properties panel type the Instance name
as 'soundani2'
8. Select frame 2 on Actions layer.
9. Choose Window > Actions
10.
In the Actions panel add the following action.
_root.soundani1.gotoAndPlay(2);
_root.soundani2.gotoAndStop(1);
// _root.soundani1.gotoAndPlay(2);
With
this action, the actionscript will enter into sound animation
1 movie clip and will start playing from frame 2.
// _root.soundani2.gotoAndStop(1);
With this action, the actionscript
will enter into sound animation 2 movie clip and will stop
at frame 1.
11.
Choose Control > Test Movie
Sound
track 1 starts playing with the sound animation 1 movie clip.
Similarly, sound animation 2 movie clip should start when
sound track 2 starts playing.
12.
Select track 2 button on the stage.
13. Choose Window > Actions
14. In the Actions panel, add the following
actions.
_root.soundani2.gotoAndPlay(2);
_root.soundani1.gotoAndStop(1);
//
_root.soundani2.gotoAndPlay(2);
With this action, the actionscript will
enter into sound animation 2 movie clip and will start playing
from frame 2.
// _root.soundani1.gotoAndStop(1);
With this action, the actionscript will
enter into sound animation 1 movie clip and will stop at frame
1.
15.
Similarly add the following actions for track
1 button
_root.soundani1.gotoAndPlay(2);
_root.soundani2.gotoAndStop(1);
16.
Choose Control > Test Movie
Check
how the musical symbols animation works with the particular
sound track.
When
we click the on-off button the sound track stops playing but
the musical symbols animation does not stop. These animations
should work according to on-off situation of the sound tracks.
17.
Select on-off clip movie clip at On-Off Button
layer.
18. Choose Edit > Edit in Place
19.
At frame 1, select on-off button on the stage.
20.
Choose Window > Actions
21. In the Actions panel, add the following
actions at the place as shown in the image.
_root.soundani1.gotoAndStop(1);
_root.soundani2.gotoAndStop(1);

// _root.soundani1.gotoAndStop(1);
With this action, the actionscript
will enter into sound animation 1 movie clip and will stop
at frame 1.
// _root.soundani2.gotoAndStop(1);
With this action, the actionscript
will enter into sound animation 2 movie clip and will stop
at frame 1.
22.
At frame 2, select on-off button on the stage.
23. In the Actions panel, add the following
actions at proper places as shown in the image.
_root.soundani1.gotoAndPlay(2);
_root.soundani2.gotoAndPlay(2);
_root.soundani1.gotoAndPlay(2);
24.
Choose Control > Test Movie
1.
Choose Insert > New Symbol.
Create a Movie Clip and name it as 'sound wave'
2.
In this movie clip create a small ripple animation
which can fit on the speaker icon.(on-off button)
3. Choose Window > Library >
on-off clip movie clip.
4. Double click the on-off clip movie clip to go inside
it.
5. Insert a new layer above On-Off Button layer
and rename it as 'Sound Wave'
6. Select sound wave movie clip in Library and
drag it on frame 1 of Sound Wave layer.
7. Place sound wave movie clip as shown in the image.
8.
Select frame 2 on the Sound Wave layer.
9. Choose Insert > Blank Keyframe
10.
Choose Control > Test Movie
Steps to create Sound Controllers is complete. Such sound
controllers can be used in Flash presentations and websites.
Regards,
All
accompanying logos, brands and product names are trademarks
of their respective companies.
|