Enter the following actions:
8
onClipEvent (load) {
top = _y;
bottom = _y;
left = _x;
right = _x+100;
_x += 100;
}
onClipEvent (enterFrame) {
_parent.song.setVolume(_x-left);
}
Select Control > Test Movie to use the volume slider.
9
To create a sliding balance control:
Drag a button to the Stage.
1
Select the button and select Insert > Convert to Symbol. Select the movie clip property.
2
Select the movie clip and select Edit > Edit Symbol.
3
Select the button and select Window > Development Panels > Actions.
4
Enter the following actions:
5
on (press) {
startDrag ("", false, left, top, right, bottom);
dragging = true;
}
on (release, releaseOutside) {
stopDrag ();
dragging = false;
}
The
startDrag()
Select Edit > Edit Document to return to the main Timeline.
6
Select the movie clip on the Stage.
7
Enter the following actions:
8
onClipEvent(load){
top=_y;
bottom=_y;
left=_x-50;
right=_x+50;
center=_x;
}
onClipEvent(enterFrame){
if (dragging==true){
_parent.setPan((_x-center)*2);
}
}
Select Control > Test Movie to use the balance slider.
9
For more information about the methods of the Sound class, see the
Chapter 12, "ActionScript Dictionary," on page
104
Chapter 5: Creating Interaction with ActionScript
parameters
,
,
left
top
, and
are variables set in a clip action.
right
bottom
205.
Sound class
entry in
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?
Questions and answers