I have tried several variations and nothing is working right. Here is what I have right now.
The actual slider is in a movie clip called slidebarMC with an instance name of slideBar. I added the code:
on (press) {
startDrag("", false, left, top, right, bottom);
dragging = true;
}
on (release, releaseOutside) {
stopDrag();
dragging = true;
}
I then created a new movie clip called sliderMC with no instance name, and placed a 100 pixel wide volume bar graphic and placed the slidebarMC movie clip in the middle of that.
I then placed that in my scene/movie clips and added the code to the sliderMC clip:
onClipEvent (load) {
top = _x;
bottom = top+100;
left = _x;
right = _x;
}
onClipEvent (enterFrame) {
if (dragging == true) {
_root.soundObject.setVolume(100-(_x-top));
}
}
I added a frame above it in the timeline and placed the action:
myMusic = new Sound();
_root.soundObject.attachSound("musicnote_01");
myMusic.start(0, 1);
myMusicVolume = 100;
myMusic.setVolume(myMusicVolume);
I have obviously screwed it up. What do I need to change to make it work in a movie clip and a scene? Thanks in advance!
The actual slider is in a movie clip called slidebarMC with an instance name of slideBar. I added the code:
on (press) {
startDrag("", false, left, top, right, bottom);
dragging = true;
}
on (release, releaseOutside) {
stopDrag();
dragging = true;
}
I then created a new movie clip called sliderMC with no instance name, and placed a 100 pixel wide volume bar graphic and placed the slidebarMC movie clip in the middle of that.
I then placed that in my scene/movie clips and added the code to the sliderMC clip:
onClipEvent (load) {
top = _x;
bottom = top+100;
left = _x;
right = _x;
}
onClipEvent (enterFrame) {
if (dragging == true) {
_root.soundObject.setVolume(100-(_x-top));
}
}
I added a frame above it in the timeline and placed the action:
myMusic = new Sound();
_root.soundObject.attachSound("musicnote_01");
myMusic.start(0, 1);
myMusicVolume = 100;
myMusic.setVolume(myMusicVolume);
I have obviously screwed it up. What do I need to change to make it work in a movie clip and a scene? Thanks in advance!