Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

horizontal volume slider issues

Status
Not open for further replies.

tallgiant

Technical User
Aug 4, 2004
10
US
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!

 
I tried that but it did not work! It seemed like it is designer for a web page. The code downloaded = mySound.getBytesLoaded();
total = mySound.getBytesTotal();
if (downloaded != total) {
_root.dl = "downloading song...";
} else {
complete = 1;
_root.dl = "";
is confusing the hell out of me. I have the mp3 files within the .fla file itself. How can I do it without have the download line? I don't understand the "downloading song" line. Does not seem relative to what I am doing. This is driving me insane!
 
Can you post a link to your .fla, zipped up and in a MX only format, not MX2004.

You would have to save a copy of your MX2004 .fla, (using Save as...) and changing the Document type to MX only in the Save as... window.
 
Thanks Oldnewbie

The .fla is at The two things that aren't working with it are:
1) It drags whenever the user places the cursor anywhere, not just the volume slider.
2) It does not function in an embeded movie clip (i.e. if I made this into a movie clip and then placed it in a scene, the slider does not work properly).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top