|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
volume slider problem?
movieA which is the volume slider on the main timeline has this code
onClipEvent (load) { top = _y+50; left = _x; right = _x; bottom = _y; } onClipEvent (enterFrame) { if (dragging == true) { _root.a.setVolume(50-(_y-bottom)); } } on the same frame but different layer on the main timeline, there is this action script a = new Sound(); a.attachSound("mySound"); a.start(secondsOffset, "100"); movieA has a button inside it with this code on (press) { startDrag("", false, left, top, right, bottom); dragging = true; } on (release, releaseOutside) { stopDrag(); dragging = false; }
__________________
INE-Kpro... (eye-yen-kay pro) http://www.INE-Kpro.com enquiries@INE-Kpro.com <--- watch this space ---> Last edited by INE-Kpro... : September 24th, 2003 at 10:32 PM. |
|
#2
|
|||
|
|||
|
part 2 of question
I changed the original 100 onclipevent code to 50 because the slider was sliding too far. it only slides half the distance now to get to the maximum or minimum. But the problem is that when I touch the slider now, the volume of the music is half as loud on maximum. I have lost maximum volume.
If I was to let it go back to 100 on the clip event part, it slides too long, but I get maximum volume. How can I cut the distance of the slider and still get maximum loudness on maximum. Can someone explain to me how this code works. Which value controls the sliding distance. Not only that, this volume slider controls the volume of everything, including my bleeps and fxs. I only wanted it to control the volume of mySound ( which I have linked properly to the music I wanted controlled). Is there a limit to the number of words per post? TIA Last edited by INE-Kpro... : September 24th, 2003 at 10:37 PM. |
|
#3
|
|||
|
|||
|
so, the concept behing this needing to represent 100 values of possible volume (That's why the original value was 100). You can' t have a volume less than 0 or greater than 100... So with this in mind, if you only have 50 scrolling amounts, just multiply it by two:
Code:
_root.a.setVolume((50-_y-bottom) *2); This way, the volue will be 0-100 but your slide will be 0-50. All the code does is drags the movieclip according to the specific constraints you passed into the startDrag() function. These are determined in you onClipEvent(load) function... need more detail on how it works? -bret |
|
#4
|
|||
|
|||
|
how about the part where it affects all sounds, how come?
how come it doesnt affect my audio that i have linked as mySound only? how do I rectify this? |
|
#5
|
|||
|
|||
|
"bump"
Last edited by INE-Kpro... : October 6th, 2003 at 10:48 PM. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > volume slider problem? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|